The mantle where diamonds are birthed is deep within Earth, down over 100 km. It's a place of high temperatures and high pressures, conditions necessary for carbon atoms to bond together in such a way that diamonds will eventually result. To make it happen, the atoms have to arrange themselves in a particular way that lets them share electrons--a regular, three-dimensional geometric pattern that, if left to grow without interference, produces large, pure diamond crystals. Volcanic eruptions throw the crystals up from Earth's depths.
The high temperatures and pressures needed to create diamonds also exist when comets or meteorites strike Earth. The shock of impact is so great that minerals change from one form to another. In this case, graphite re-forms into diamonds. (Like diamonds, graphite is also made from carbon but joined in a different pattern.) Geologists look to such diamonds, sometimes only microscopic in size, as evidence of impact. Meteor collisions in space also result in diamonds.
There are two main processes by which manmade diamonds are created: the high-pressure, high temperature method (HPHT) and chemical vapor deposition (CVD). The first tries to create conditions similar to that found in Earth to create diamonds, resulting in crystals useful for industrial purposes such as drilling or cutting. In the HPHT method, seeds of diamonds are placed in a chamber along with graphite. High pressure is applied mechanically by devices such as pistons or anvils, along with high temperatures. The graphite's carbon atoms begin bonding to the seeds and grow diamond crystals over the course of days.
Larger diamonds are created through the CVD process, which also uses a small diamond as a seed. The seed is placed in a chamber along with carbon bearing gases, where they are microwaved. This makes carbon atoms separate from the gas and fall upon the diamond seed. Using the seed as a building base, the carbon atoms join to form the geometric pattern that builds a diamond crystal.