It's simply telling the program to continue running until it is requested to quit.
You could also write, say, while(1){} but then the Hooks will not receive messages, and the program will use an entire (virtual) CPU core (e.g. Takes 100% on a single core, 50% on a dual core, 25% on a quad core...).
If lpMsg is NULL, it means we don't want the actual message.
We just need the return value to know when we are requested to quit.
GetMessage handles hook-callback messages.
The specific callback is known since the SetWindowsHookEx call.
Note: A (hook) callback message is not like a windows message:
Translate/DispatchMessage does not apply here.