What is an air compressor usually used for? What role does it play?

The above picture is a relatively simple oil-free silent piston air compressor, which mainly compresses and stores the air in a jar lying below the above picture, and then the pressure inside is high (can be set). When gas is needed, it can be exhausted through connecting pipes. The most common is used to pump air, and other industries are used as power. As for what you said about water removal, there will be water in compressed air, which is physical common sense. When some industries require that the gas must be dried, a dryer (air-cooled, so it is called freeze dryer, and there is also an adsorption dryer) will be connected to the air outlet of the air compressor.

The blue one in the picture above is an integrated air compressor, which is more intuitive, including an air tank (lying below), an air compressor on the left and a dryer on the right.