In The Last of Us, the AI was crafted so that the humans in this world react based on what weapons you expose. They read your defenses like a poker hand and react appropriately. Group behavior in the AI has it so that all enemies are aware of each other, and they'll work together to take you down. For instance, if they find a body, they'll work together to investigate and find out who killed this person. All of this work helps to provide an experience where it will seem like you're up against other humans stuck in the same world, trying to survive.
Ellie's movement and behavior is controlled by AI that adapts to player choice and performance. There are rule sets that look for how challenges play out as you play as Joel. So, if Joel engages enemies offensively, Ellie will follow. If Joel chooses stealth, Ellie will try to follow, with her motivations falling right in line with the player's. The game will track things like inventory, tendencies and other triggers to change Ellie's behavior dynamically, meaning that if Joel needs help, Ellie will probably try to help out. The goal was to make her feel like another human in the same situation, and you'll see her grow over the course of the game.
What's exciting is that all of this comes together to make for a game that plays out differently every single time. In this demo, for example, Joel and Ellie could have taken another path toward their goal, with different items and obstacles for them to deal with. And even on the same path, with different actions, Ellie's reactions would also change, making for a different experience. The AI would have enemies also reacting differently, perhaps moving differently, or changing their tactics.