When the people playing an RPG feel like their choices can/do have meaningful impact on the game, we say they have agency. If we'll succeed no matter what bad choices I make, or if we'll fail no matter what good choices I make, I have no agency.
Without agency in a game, players become pawns used to tell someone else's story, and many people find it frustrating to be objectified this way. Avoiding that frustration is why such importance is placed on player agency. 1 Agency in a narrative indicates who the story is really about (this is why the quality of a villain often makes or breaks a novel or film, when the villain's choices drive the plot because the heroes are just reacting to her), so it's important to be conscious of where the agency lies in our games. Agency is at the root of "say yes or roll the dice" for this reason.
Agency is a massively complex concept with tendrils into all corners of society. For our narrow purposes, let's start by saying that agency in a game takes on several different scopes: "player" agency2 can be seen as the all-encompassing umbrella category; character agency, plot agency, world agency, and personal agency, are some of the forms or channels which player agency can take. Another way to understand these scopes is through stances: character agency maps roughly to the Actor ("What would my character do?") and Author ("What would be good story for my character to do?") stances, while player agency can also encompass the Director (What's going on in the world and what's it like?") stance. I'll be referencing this later on.
Many explanations of agency conflate player agency with character agency, which is understandable because in many RPGS player agency is most visible through control of a single character in the game (especially in more "traditional" or D&D-like games): players make choices through a character, and those choices have meaningful effects on the game, but the player rarely gets to make game-influencing choices external to their character. (Except through social means unrelated to the game's structure, like convincing the GM to allow a borderline option, expressing a desire for a certain kind of story, or helping to choose which system to play.)
This "traditional" play style assumes that each player has one character and the Venn diagram of player agency and character agency precisely overlaps. Agency, in this style, is focused on the choices I make in building my character (feats, weapons, spells, etc) and the choices I make through my character (who and when to attack or trust, which door to open, what clues to follow, etc) in Actor and Author stances during gameplay. Players rarely, if ever, have access to the Director stance in this play style--that stance is reserved for the GM, who has however much agency she cares to wield in whatever stance or form she cares to wield it.
The "traditional" style (equating player agency with the agency of a simple character) is, however, only applicable to a certain segment of RPGs. Many RPGs enable player agency in a variety of other ways.
- In Pilgrims of the Flying Temple, I give other players control of my character whenever he's about to get in trouble: in those moments I've lost character agency while others have gained it. (Interestingly, the mechanics preserve some amount of Actor stance for me in this situation, while giving Author and Director stance to the others.)
- In Fate, players can use skills or game currency to define setting details external to their character: player agency reaches wider than character agency. (Director stance.)
- In A Penny For My Thoughts, the player whose turn it is retains Director stance, but two other players in Author stance present character choices for that player to choose from, largely through Actor stance: one character's agency is shared amongst three players during every key decision.
- In Lovecraftesque, a single character is passed around the group: during each scene a different player has character agency (Author/Actor stance) while the remaining players share agency over the rest of the scene (Director stance).
- In the Dresden Files, players collaborate to design the setting, its primary NPCs, and the main themes of the plot, before they make player characters at all: player agency creates the world and kicks off the story before character agency is even possible. (Director stance, no Author or Actor need apply.)
- Games that are Powered by the Apocalypse limit the GM's agency by linking it to the agency of other players: Often a GM's Director-stance move ("A thing happens in the world!") is triggered by a player's character agency, but it might even be triggered by a player at the table looking to the GM to see what happens next.
Agency does not imply informed choice. But it often should! Truly, player agency simply means our choices matter--not that we're empowered to make good choices based on useful information. Paranoia is a good example of an RPG which leverages blind agency for enjoyment. Often, however, blind choice can be just as frustrating as no choice, and avoiding frustration in our leisure time IS a major goal behind understanding player agency. This is why most games assume some level of informed context is provided to us, and why many answers on this site invoke player agency to protest players being kept ignorant.3
1 I once played in a group where the GM used our characters to tell his stories: if we tried to do something that'd derail his story, it failed just because. We won when it was time to win, and lost when it was time to lose. Everyone at the table was okay with it, because his stories were awesome and we knew this would happen going in. By choosing to be part of his group, we'd used our player agency to knowingly sacrifice our character agency in order to experience his stories.
2 Here I'm using "player" for its jargon definition of "RPG participant who is not the GM." It's clunky, as you'll see when we get into non-traditional games where the Director stance isn't reserved for a single individual or GM agency is more limited than in traditional play styles, so you'll see me stumble over terminology later on. (This use of "player" also kinda implies the GM isn't playing the game too, which is sad. I don't have a better word, but if you know one, please tell me about it!)
3 A related and controversial subject is when informed player agency modifies the effects of an uninformed character's agency. This is a subset of actions is often called "metagaming," specifically using "out of character" knowledge to influence "in character" action. It's beyond the scope of this answer and only tangentially relevant to this question, but comes up in this context often enough to merit mentioning. Please refer to the stances for further insight; it can usually be understood as a conflict between players' preferences for Author or Actor stances.