What is the meaning of [Where one door shuts, another opens]

When you lose an opportunity to do one thing, an opportunity to do something else appears.

Example: X: I failed to get into my dream college. Y: Don’t worry, this has happened with many. I’m sure something better is waiting for you. Where one door shuts, another opens.