Petrochemicals are derived from petroleum through a process called refining. Crude oil, which is a mixture of hydrocarbons, is heated and separated into various fractions based on their boiling points. These fractions are then further processed to produce petrochemicals such as ethylene, propylene, benzene, toluene, and xylene, which are used as building blocks for a wide range of products.