When you die your organs shut down and then after awhile your body becomes stiff.
Just a few minutes after your death your body begins decomposing and the enzymes in your body starts breaking down cells, releasing gasses along the way that cause your dead body to bloat up.
Then as your bodies organs decompose, capillaries break open and blood leaks into the body, giving the skin a purple color tone.
Then your body starts getting stiff within 2 to 6 hours after death which is known as rigor Mortis.
The Rigor mortis begins in the muscles of the jaw and neck and proceeds downwards in the body to the trunk and extremities and complete within 6 to 12 hours.
If you don't get embalming fluid in the body soon enough then the body begins decomposing faster and then the body begins to smell bad.