An air compressor is a mechanical device that converts power, often from an electric motor or a gasoline engine, into potential energy stored in compressed air. It achieves this by compressing and pressurizing atmospheric air, which is then stored in a tank or released through a hose for various applications.