Air is a general term used to describe the collection of gasses in earth's atmosphere. Typical automotive engines which run on gasoline or diesel to power internal combustion need the oxygen (O2) from air to make combustion possible. Air also creates drag as we pass through it, with the drag amount raising exponentially with speed.
Typical Composition of Air
When free of humidity/moisture, air contains roughly 78% nitrogen, 21% oxygen, .93% argon, .041% carbon dioxide (CO2), and trace amounts of other gases. The amount of oxygen can be artificially increased to improve power output.
Air's Role in Combustion
Combustion, a form of rapid oxidation, releases energy mostly in the form of heat as the oxygen is chemically bonded to elements in the fuel. The heat causes the remaining air to expand, pushing down on the piston. After this, the piston pushes out the post-combustion gasses. If the vehicle is equipped with them, the O2 Sensors will try to detect remaining oxygen, which is either a sign of incomplete combustion or a poor air/fuel ratio.
The density of air matters a lot to an engine, which is why forced induction (such as a turbocharger or supercharger) works so well for improving engine power. At high altitudes, the air is thinner, which will result in the feeling of reduced power, especially in vehicles powered by naturally aspirated engines. Even though the vehicle is driving through less dense air, it's still moving the same amount of weight around, and getting less air to mix with fuel to make power to move that weight.
Tuning at Pikes Peak by HPA
In this video, Andre Simon explains the basics of tuning for the hill climb race in Pikes Peak, Colorado (USA), where the atmospheric pressure drops considerably from the beginning of the race to the end. In the thumbnail and the video is HPA's Ford Focus hill climb race car.
Air purity is often not an issue, since most engines are equipped with air filters. However, air with exceedingly high particulate counts may clog the filter quickly, gradually reducing engine power until it simply cannot run any more. These environments may demand larger air filters to provide more surface area, but these tend to be selected for a vehicle before production, and are typically equipped on heavy equipment, especially when used for farming, construction/destruction, mining, and harsh environment exploration.
However, air purity can affect the driver and passengers of a vehicle, too! A cabin air filter is used to keep the air in the cabin clean, and there are often options available so the filtering can be customized to the particular environment a vehicle frequents.
When the air available and forced induction isn't enough, high oxygen content gasses such as nitrous oxide can be added to the engine's intake to provide more power, based on how much is used and limited by on-board tank capacity. Nitrous oxide is written as NO2 and consists of about two thirds oxygen and one third nitrogen, which is a much more potent dose of oxygen than the natural air.
While technically a tank of pure oxygen (O2) or ozone (O3) could be used for even more benefit per unit of space used, the safety/explosion risk is too high, and it can cause the engine to produce so much power that it generates enough heat to melt itself. Even with the tank metered to an extremely low flow rate, the explosion risk is too high, and most forms of racing have banned storing any form of pure oxygen.