Peat bogs are drained, and the partly decayed sphagnum moss near the surface is stripped off and dried. As of 2013 the US got up to 80% of its sphagnum peat from Canada.
Coir pith, the spongy dust left over from coconut fiber processing, is a common peat substitute. Raw pith carries too much sodium and potassium for plants, so it is washed and soaked in a calcium solution to swap those salts out.
Raw perlite is volcanic glass with water locked inside. In a furnace it softens, the water flashes to steam, and each grain swells 7 to 16 times into a bright white, bubbly bead.
Peat is acidic, so ground limestone is weighed in to raise the pH. Dolomitic limestone is preferred because it adds magnesium as well as calcium, and slow-release fertilizer supplies what the bulk materials lack.
Water-holding and air-holding ingredients are tumbled together in proportions matched to the plant. Cactus mixes take much more perlite or sand, and seed-starting mixes stay light and fine.
The finished blend is metered into plastic bags and sealed for sale.