The above idiom means that everyone gets eventually a chance to be successful at something, sometimes, in his/her life. The phrase even appears in Shakespeare's play, 'Hamlet'. There was also a successful movie with this title. It is said to have been first uttered by Queen Elizabeth 1.
The idiom can also mean revenge. In hebrew this is a very popular revenge saying :(kol kelev ba iomo) כל כלב בא יומו The source in this case is arabic, and the word 'dog' stands for a despicable person whose day of punishment will sure arrive. Strange as it may seem, I believe there's some truth in this rather primitive saying. How come?
Well, I notice over the years, that although I've completely lost touch with people that have done me wrong at one time or another, nevertheless , news about them reach me through all sorts of unexpected ways, as if to notify me that 'justice has been done'.
I never ever rejoice at bad news ( I get sad even when I hear of a captured terrorist being "neutralised"), but being human, I can't help feeling sometimes pleased that things have come full circle. The person who has done me wrong has been somehow punished (or.. perhaps not; if it's a divorce, may be he's happy about it, lol).
Anyway, the mere belief in this kind of saying, sets one free from remembering such a person or having any feelings about him - and that's a big Relief.