There are three requirements for a geyser: water, heat, and a special plumbing system below the surface. Yellowstone is one of only a handful of places in the world which meet these conditions. Its unique thermal features are a result of its volcanic origins.
The average continental crust is 30 kilometers thick. But, at Yellowstone, there is a hot spot where the crust is thinner, only about 10 kilometers thick. This causes volcanic eruptions. The last was was just over 600,000 years ago. Water enters the ground and enters the region above the hot spot. As it picks up heat, it heads towards the surface.
The plumbing system of the geyser connects it to the water reservoir. The boiling, highly pressurized water flows up the plumbing system of the geyser. Eventually it encounters the cooler water that is up at the surface of the geyser. As more hot water fills the geyser, more and more steam rises to the surface. Constrictions within the plumbing system and cooler water just below the surface block the hot water from traveling further upwards. When pressure from the hot water sufficiently builds up, the hot water and steam are forced up to the surface. The release of some of the hot water causes the pressure to decrease, and more hot water is converted to steam. This steam expands up to 1500 times its original liquid volume and the geyser erupts. After the eruption, the pressure is released, and the cycle begins again with the geyser recharging the supply of hot water.