It's similar to the notion of karma. I you do bad things in life, there is a good chance that similar bad things will eventually happen to you. It is often said when something like this occurs.
For example, imagine there is a business owner who cheats his employees and customers. He forms a partnership with another business owner. Later the partner cheats him out of all his money. People would then say, "what goes around comes around."