This idiom represents the moment you realise that (usually) your life is not going as well as you thought it was. It is associated with a sudden change. Something you did not expect. A new way, normally negative, of looking at the world around you.
When John saw his wife with another man was when the ground fell out from underneath his feet.
When the ground falls out from underneath your feet, you will realise you were not aware of the situation.