Think of it this way: For each new value that's pushed onto the 'stack', you pop all of the values from queue1 onto queue2, then push the new value onto queue1. Taking a simple example, say you have queue1 with a single value, 1, and you want to push 2 onto it so that the next pop gives you 2 instead of 1:
queue1: * 1
queue2: *
Empty queue1 onto queue2:
queue1: *
queue2: * 1
Push 2 onto queue 1:
queue1: * 2
queue2: * 1
Then empty queue2 onto queue1:
queue1: * 1 2
queue2: *
So now, by pushing 1 and then 2 onto the queue this way, popping them both off would give you 2 1, just like a stack, instead of 1 2, like a queue.