The air conditioner with a pipe, also known as a vented air conditioner, works by drawing in warm air from the room and passing it over a cooling coil filled with refrigerant. The refrigerant absorbs the heat from the air, causing it to cool down. The cooled air is then circulated back into the room, while the hot air is expelled through a pipe to the outside.