1. What does an AC relay (or any relay for that matter) actually do?
2. Could a faulty AC relay cause the AC to work intermittently?
I’ve had the AC checked and charged. No leaks were discovered and it works great, sometimes.
Most relays are basically used as an electric switch and commonly used in circuits that require switching control of currents loads that are fairly high and would damage a small switch. Using a relay in the circuit will allow a small switch to turn on a big current load. The relay has a coil that will close the switched contacts when the coil is energized by the smaller switch connection to power. The AC relay normally switches power to the AC compressor clutch.
Relays can become intermittent if the swiched contacts become damaged over time due to arcing. A lot of times you can swap relays if you suspect one is bad since they use the same style of relay for other things. Your trouble could be due to a bad relay but other things can cause the trouble also.