Air is about 78% nitrogen and 21% oxygen. At normal temperatures these two gases do not react with each other. Inside a car engine the burning fuel makes the temperature very high, and then nitrogen and oxygen from the air can react together.
The products are oxides of nitrogen, such as nitrogen monoxide, NO, and nitrogen dioxide, NO2. For example: N2 + O2 → 2NO. The nitrogen comes from the air and not from the fuel. This is different from sulfur dioxide, which forms because of impurities in the fuel.
Oxides of nitrogen are pollutants. They can cause breathing problems and they help to form acid rain.