At high temp, the petrol and diesel engines, N2 & O2 combine to form NO which is emitted into atmosphere. NO is then oxidised in air to form NO2 which absorbs sunlight and form NO and free O atom.
NO2(g) + sunlight → NO(g) + O(g)
The O atoms being reactive and combine with O2 to form O3 .
O2(g) + O(g) → O3(g)
The O3 react with NO formed by the photochemical decomposition of NO2 .
NO(g) + O3(g) → NO2(g) + O2(g)
NO2 and O3 are good oxidising agents and they react with unburnt hydrocarbons in the polluted air to form substances such as acrolein and formaldehyde. These are the main substances of photochemical smog.