Mental Model
We use a stack to keep track of opening brackets and check if each closing bracket matches the last opened one.
Analogy: Imagine stacking plates: you put plates on top when you see an opening bracket, and you remove the top plate when you see a matching closing bracket. If you try to remove a plate when none is there or the plate doesn't match, something is wrong.
Stack (top at right): []
Expression: ( [ { } ] )
Initial:
Stack: []
Expression pointer ↑ at '('