Calcium, magnesium, and sulfur are called secondary nutrients, not because their importance is secondary but because they are found in most soils and seldom need to be added as fertilizer.
Calcium and magnesium are the elements that are largely responsible for the acidity or alkalinity of soil. They are moderately soluble, so in regions of high rainfall they are washed from the soil and carried away. Soils in these regions are usually acid, and lime (calcium carbonate) is often added every year to make the soil less acid. In areas of low rainfall, and where the soil is derived from limestone, the soil is high in calcium and magnesium and is usually alkaline.
Sulfur is present in many commercial fertilizers, even though it is not listed on the label. As sulfate, it is highly acid and is often used to make alkaline soils acid.