Nearly 99% of the mass of your human body consists of just 6 chemical elements: oxygen, carbon, hydrogen, nitrogen, calcium, and phosphorus. Another 5 elements make up most of the last percentage point: potassium, sulfur, sodium, chlorine, and magnesium.
I believe the answer you're looking for is Evolution.
To provide genetic diversity from parents to offspring through “crossing over” over the genes in prophase.