This post at Once More Unto the Breach got my brain percolating on the idea of consequences of the players' actions and choices, specifically in the context of a sandbox-style campaign. It's worth a read, so pop over and take a look if you haven't already. I'll wait right here.
Back? Good; you're up to speed, so let's dive right in.
Obviously, we're talking not of the immediate consequences of individual actions during an adventure, like swinging a sword or drinking a potion, but of the long term ramifications of major decisions and cumulative player actions. I think it's entirely possible, and sometimes even fun, to play a consequence-free (or nearly so) sandbox campaign. In fact, that's pretty much what my early days DMing were like. The only consequences to the party's exploits in the Caves of Chaos were that the areas they cleaned out either remained empty or something else moved into them. My players weren't inclined to stir up trouble in the Keep, so that was a non-issue.
However, I also think that the sandbox is the only campaign format in which the consequences of player choice can be fully applied and experienced. There's no overarching plot to protect. There are no locations or NPCs that can't be altered or eliminated. There are no connections and relationships that absolutely have to be cultivated in any particular way.
Compare the railroad or plot-driven campaign. Players' choices must be steered toward those that produce certain predetermined consequences, or else outcomes must be fudged or contrived in some way to build some tenuous causal link, post hoc, from the players' choices. Consequences are present, after a fashion, but in a very limited sense, and the chain of causality is effectively reversed. Instead of choices leading to consequences, consequences retroactively prescribe choices.
Only the sandbox, then, can operate at the extremes of the consequence continuum: completely consequence-free or with full and logical consequences applying.
Player agency is present at the consequence-free end, but only ephemerally, with regard to immediate in-game actions. Player characters may try to pick the lock of the jewelry shop, or swing a sword at a guard, and either succeed or fail to open the lock, and succeed or fail to kill the guard. Once the scene ends, though, there's no eternal enmity from the jeweler or the guard captain or the wife of the dead guard or the community, nor any sanctions against the PCs from the local ruler. Just like a TV sitcom, the status quo returns every time the credits roll at the end of an episode.
The fullest flowering of player agency comes only at the full consequences end of the scale, because of course agency is all about player choices being meaningful, and at that point on the scale they are meaningful not only in the moment, but in the long run as well. Agency isn't just about letting the players do whatever they want; it's also about what they do having the power to affect their imaginary environment.
If the players respond to a trader's complaint about the threat of monsters on the trade route, and take it upon themselves to clear them out, they should be able to rely on the trader's good will afterward. They should notice an increase in merchant traffic, and improved prices or variety of goods for sale, maybe even an overall increase in the prosperity of the town or region.
If they expose a plot by the baron of Thunderfell to undermine his rival, then that should color the reactions of the baron and his loyalists, and of the rival and his men, far into the future.
If they turn outlaw and attack the king's soldiers, then there's going to be a bounty on their heads, and they won't be welcome in civilized places where the king's law is well regarded for a long, long time to come, perhaps the rest of their lives - unless they do something to change it.
If the PCs act as men and women of their word, NPCs learn to believe and trust them. If their actions are capricious and unpredictable, NPCs learn to be wary and distrustful of them.
If they accept quests to aid the common folk, they'll earn a reputation as folk heroes. If their only loyalty is to gold, they'll be seen as self-serving mercenaries.
If they foolishly release the vampire lord from the mirror of life trapping, then there's probably going to be an outbreak of vampiric murder and mayhem across the land.
A more difficult, but potentially highly interesting application of consequences is to extend them to player inaction as well. If you provide lots of adventure hooks, and let the players choose among them, what happens to the ones they don't choose?
If they decide to go hunting dragons instead of searching for the merchant guildmaster's missing daughter, what happens to her? Does she die, is she never seen again, or does some other band of adventurers take up the thread? Do they succeed, fail, or fail spectacularly? If the party does choose to rescue her, and leaves the dragons alone for the time being, does the threat of the dragons grow, making them more dangerous if and when the party does get around to dealing with them?
There are a few different general ways in which things could change without the players' intervention, and each can serve to motivate them in different ways.
The situation can escalate, as in the case of the dragons. Like weeding a garden, sometimes things put off for too long become orders of magnitude worse in the meantime.
It can end in tragedy or disaster, as it might with the merchant's daughter. The party can't be everywhere at once, but something like this reminds them that how they rank their priorities is important.
The situation can improve. Perhaps the local burgomasters collect funds to bribe the dragons to move on to other hunting grounds. Maybe the merchant's daughter makes a daring escape from her captors and turns up in town a week later, battered and ragged but alive. This serves to remind the players that, while their characters are powerful adventurers, the rest of the world doesn't just sit around passively waiting for them to ride to the rescue. It's still good to leave the players with the feeling that things might have turned out even better if they'd been involved, though. The townsfolk wouldn't have had to hand over their wealth to the dragons, or the girl's fellow hostages might not have been sold into slavery by the kidnappers.
It can result in another party of adventurers beating them to the punch and getting the gold and the glory. Rivalry can be very motivating.
The important thing is not to leave adventure hooks hanging too long. They'll resolve themselves one way or another, with or without the intervention of the player characters. Sometimes they mutate and morph into other hooks. Sometimes one door closing opens up new ones. I think it's a good idea to keep a list of open adventure hooks, and between game sessions, evaluate the status of each one, deciding if or how the situation has changed, and then seed news and rumors into the next session accordingly.
In the sandbox, the PCs should be a force in shaping the course of the campaign world, for good, ill, or indifferent. Their decisions and actions should be a deciding factor in whether an NPC ends up as ally or adversary, rather than simply scripting characters to fill those roles. An NPC who develops organically into a loyal friend or a bitter enemy over the course of a campaign is a lot more engaging to player emotions and imaginations than one simply created for the role. A sandbox of full agency and consequences allows players and referee alike to experience success, disappointment, surprise, uncertainty, triumph, regret...and they're the real deal, not scripted and preordained.