During the sleep-wake cycle, the brain undergoes profound dynamical changes, which manifest subjectively as transitions between conscious experience and unconsciousness. Yet, neurophysiological signatures that can objectively distinguish different consciousness states based are scarce. Here, we show that differences in the level of brain-wide signals can reliably distinguish different stages of sleep and anesthesia from the awake state in human and monkey fMRI resting state data. Moreover, a whole-brain computational model can faithfully reproduce changes in global synchronization and other metrics such as functional connectivity, structure-function relationship, integration and segregation across vigilance states. We demonstrate that the awake brain is close to a Hopf bifurcation, which naturally coincides with the emergence of globally correlated fMRI signals. Furthermore, simulating lesions of individual brain areas highlights the importance of connectivity hubs in the posterior brain and subcortical nuclei for maintaining the model in the awake state, as predicted by graph-theoretical analyses of structural data.