We talked about global and local axes. Now you see the difference in action. You tap once to specify moving along a global axis, you tap twice to specify moving along a local axis:
You discovered that when you press the G key you can restrict the motion to the global Z plane by pressing the Z key once. If you press the Z key two times in a row, motion is restricted to the local Z plane. The same applies to the X plane and the Y plane.