(If you aren’t a fan of the d20 system, you may want to bail now.)
The d20 system justifies attacks of opportunity (AoO) thusly:
Sometimes a combatant in a melee lets her guard down. In this case, combatants near her can take advantage of her lapse in defense to attack her for free. These free attacks are called attacks of opportunity.
Hogwash! Yes, this is a role-playing game, and that’s not a bad way to rationalize it “in character”. The truth, however, is that this is primarily a game mechanic. It’s better—in my opinion—to understand the real reason AoO exist and that the description above is simply a façade.
The AoO rules are really a form of zone of control (ZoC) rules that were used in war-games long before role-playing games. Many role-playing games have included such rules as well, but they are often simplified enough that they don’t stand out the way that they do in the d20 system.
Indeed, within classic D&D can be found the origins of the d20 system’s Withdraw action, five foot step rule, and five foot threat range. (Also note that, in classic D&D, missile weapons cannot be used while in melee.)
Now, back to the d20 system. Let’s say we’re playing a d20 game without ZoC or AoO rules. An orc stands in the middle of a 15 foot wide corridor. Ten feet away stands a fighter, and a mage stands behind the fighter. The orc wins initiative and can move past the fighter, past the mage, and attack the mage. Even worse, if you’re using the optional facing rules (from Unearthed Arcana), the orc would be attacking the mage from the rear.
(Click on images for a bigger version.)
If this were “real life” (replace the orc with a generic bad guy), the fighter and the mage aren’t going to let the orc walk past them to attack from the rear.
With typical ZoC rules, the orc would have to stop his movement for that round once he moved into melee range of the fighter. (In fact, the first d20 Star Wars rules worked this way.)
The d20 designers wanted to replace restrictions with consequences. (That is a common theme in the d20 system.) So, instead of a simple ZoC that stopped an opponent’s movement, they needed a consequence for violating a ZoC. The consequence they choose was the risk of suffering a free attack, an AoO.
AoO also proved useful to provide consequences instead of restrictions in other cases. Many games simply say that you can’t fire a ranged weapon when in melee range of an opponent. The d20 system, however, makes it draw an AoO.
Now, I’m not going to say that AoO was the best choice. I might have preferred that instead of AoOs, actions be restricted with skill checks being able to overcome the restrictions. Similar to how the Tumble skill allows characters to move through an opponent’s square. But then, the way I prefer to run combat, I generally don’t need ZoC rules. Anyway, my point is that the AoO rules should be understood as a kind of ZoC rather than a lapse in defense.
ZoC and AoO rules only go so far, however. Put the orc, fighter, and mage in an open area; and now the orc can avoid the fighter’s threatened squares to attack the mage.
This can be mitigated—to an extent—if the fighter previously readied a move triggered by the orc’s movement, but it’s—in my opinion—a needlessly complicated affair.