In order to make sure all airplane passengers are comfortable, and also that the trip is survivable, most airplane cabins are artificially pressurized. This pressure is caused by a number of different processes, but the main way airplane cabins are pressurized is by pumping compressed air into the cabin. Without this air pressure, passengers would likely lose consciousness or become very lethargic.
Most airplanes are artificially pressurized once the aircraft reaches an altitude of more than 10,000 feet (3,048m). With a cruising altitude closer to 30,000 feet (9,144m), passengers would likely lose consciousness in a matter of seconds without the cabin being pressurized. This would likely lead to death, simply from the lack of oxygen alone.
In order for an airplane cabin to be artificially pressurized it first must be airtight. If there are places where air can get out, the plane loses pressurization very quickly. This is why in movies, for example, once an airplane’s hull is breached, the pilot will immediately attempt to move it to a lower altitude.
Once an airtight cabin is achieved, the easiest way to pressurize it is to use the airplane's engines to do most of the work. Air passing through the engine is heated to a very high degree, and thus naturally becomes artificially pressurized. This pressurized air can then be cooled and the pressure reduced to the desired level.
The fact that all commercial jets are have artificially pressurized air also helps refute the misconception that all airplane air is stale. In fact, to achieve the desired pressurization, new air is constantly being pumped into the cabin and old air is being released. While airplane air may be unique, it is truly not stale.
One reason many may think airplane air is stale is because it is easy to feel sleepy on an airplane, like an individual is not receiving enough oxygen. In fact, that may very well be the case, especially for those living near sea level. While planes are artificially pressurized, the level to which they are pressurized is approximately equivalent to an outside altitude of 8,000 feet (2,500m). Therefore, those who feel they are not getting the same amount of oxygen they would get outside the plane may be correct.
While using the engines are the best way to achieve artificially pressurized air, there are other options as well. Some planes will use an independent air compressor system to achieve the necessary pressure. This technique usually bypasses some of the health concerns that may come with using air from the engine, even if it has been purified before going into the cabin. The Boeing 747 often uses independent air compressors for cabin pressurization.