Comparison with top

Hi,
Please explain why we are comparing current element with only top element of stack?

plz mention the timestamp in the video

At 11:54. Also, I raised doubt on this problem solution . Please help in that also.

first we check with stack top element
and then if condition true then only we pop the elements
otherwise move ahead