Because stack follows last in first out. So in the equation, the braces which appear immediately before(last in) the enclosed expression, the closing brace of same type should follow the expression immediately(first out). If this isn't present, the equation has unbalanced braces/parentheses.
Tree