Plants need nitrogen and phosphorus in forms that dissolve in water. Nitrogenous fertilisers, such as urea and ammonium nitrate, are made from ammonia. Phosphatic fertilisers are made from rock phosphate, Ca3(PO4)2, which is almost insoluble. Treating it with acid changes it into soluble calcium dihydrogenphosphate, Ca(H2PO4)2.
Crude petroleum is a mixture of hydrocarbons. Refining separates it by fractional distillation into fractions with different boiling ranges. Cracking then breaks large molecules into the smaller ones needed for petrol, and gives alkenes as well.
Alkenes from cracking, mainly ethene, are the starting materials for plastics and many other petrochemicals.