There are two Wait() methods in the sync package. One is on the type Cond and one is on the type WaitGroup.
Assuming you mean waitgroup, the code uses the runtime call Semacquire which is a semaphore lock. In that case, you are not looping anymore, but waiting until said semaphore is released. It is released if a call to .Add reaches 0 (Note that .Done is Add(-1)).
Assuming you mean Cond, the code uses the runtime notify list primitive to park the goroutine until either Signal or Broadcast is called at which point execution continues.
If this doesn't answer your question, please do not hesitate to elaborate what your concern is.
J.