By forcing air into a container and pressurizing it, the air compressor starts working. Then, through an opening air is forced into the tank, where pressure builds up suddenly. Think of it as an open balloon and the compressed air can be used as energy as it's released from it.