The carbon that makes diamonds comes from the melting of pre-existing rocks in the Earth’s upper mantle. There is a surplus of carbon atoms in the mantle and when temperature changes in the upper mantle force the carbon atoms to go deeper where it melts and the temperature cools, it becomes new rock. If other conditions, such as pressure and chemistry, is right then the carbon atoms in the melting rock bond to build diamond crystals. But there is no guarantee that these carbon atoms will turn into diamonds. If the temperature rises or the pressure drops then the diamond crystals may partially melt or totally dissolve. Even if these diamond crystals do form, it takes thousands of years for those diamonds to come near the surface.
Diamonds formed in the deepest parts of the earth may be the remains of long-dead sea creatures and might be evidence of the extreme depths to which Earth can bury its dead and recycle their remains.
Most diamonds come from the bottom of thick continental crust and are believed to be primordial carbon that got inside the Earth when the planet was first formed. Scientist believe that billions of years ago a slab of oceanic crust was subducted, or pushed under, another crustal plate. As the subducted plate sank to greater depths and pressures, the remains of any sea life were reduced to graphite, and then pressed into diamonds. But the slab kept sinking to the lower mantle, as minerals called majorite within the diamonds confirm. The diamonds made their way back to the surface the same way all diamonds do, thru a rapidly rising carbonated volcanic eruption called a kimberlite.