When the skin is hit forcefully, such as from a punch, blood is leaked under the skin from the blood vessels. Then the blood cells rise to the surface of the skin.
The released blood cells lose their oxygen, becoming darker red (days 0-2).
As the iron leaches out of the blood cells, the bruise becomes purple (days 2-5).
As the hemoglobin from the blood cell breaks down, it releases a chemical called biliverdin, and the bruise looks green (days 5-7).
As the biliverdin breaks down, the bruise becomes yellow (days 7-10).
Finally, the biliverdin is absorbed by the body and it goes away.