Diamonds are formed deep within the earth about 100 miles or so below the surface in the upper mantle. The combination of high pressure and high temperature is what causes diamonds to form.
Diamonds that appear at the surface of the earth were brought up by very deep -seated volcanic eruption. It is a very rare and unique kind of volcanic eruption that is very violent. These eruptions occurred long ago carrying the already formed diamonds from the upper mantle to the surface of the earth.
On reaching the surface of the earth, it built up a mound of volcanic matter that eventually cooled, and the diamonds were contained within the cooled mound. These mounds are called Kimberlites and are typically the source of many of the world's mined diamonds.