Magic's stack operates on a last-in, first-out (LIFO) principle, defined in CR 405.6. This means the most recently added object on the stack is always the first one to resolve. So if you cast Spell A and then cast Spell B on top of it, Spell B resolves first.
When a player casts a spell, it is placed on top of the stack (CR 601.2). Once all players pass priority in succession without taking any action, the top object of the stack resolves (CR 608.1). After it resolves, players receive priority again before the next object can resolve.
This matters enormously for sequencing decisions. A player can respond to an opponent's spell by casting their own spell on top of it, knowing their response will resolve first and potentially change the game state before the original spell takes effect.
Concrete example: Your opponent casts Lightning Bolt targeting your creature. You respond by casting Giant Growth on that creature. Giant Growth is now on top of the stack. Giant Growth resolves first, giving your creature +3/+3. Then Lightning Bolt resolves — but your creature may now survive because of its boosted toughness.
Remember: priority (CR 116.1) is what allows players to add spells or abilities to the stack in response to each other. Each time a spell or ability resolves, priority is returned to the active player before the next item can resolve.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.