The A/C clutch connects the engine drive belt to the compressor. When you switch on the air conditioning, electrical current flows through an electromagnet behind the pulley. This magnetic pull draws the clutch plate against the spinning pulley, locking them together to spin the compressor shaft. When the cabin cools down, power cuts off and the clutch releases. This lets the pulley spin freely without running the compressor, saving fuel.
Clutches wear out over time from constant cycling. If the air gap between the clutch plate and pulley gets too wide, the magnet cannot pull the plate in, leaving you with warm air. You will often hear a loud clicking sound when it struggles to connect. If the internal clutch bearing fails, it will make a constant rattling or grinding noise whenever the engine runs, even if the A/C is turned off.