Class A operate with their amplifying devices operating over the entire input cycle. That means they stay on the whole time.
Class B operate only half the time. Operate them in push pull and one devices does the + side while the other does the - ve of the waveform.
Class B is much more efficient. A 20w class A will have big heatsinks like a 200w class AB.
Class AB is considered a good compromise, where many start at class A then switch beyond a certain threshold. You get crossover distortion added as a result. Class A is considered more accurate.
Class D is more efficient again because the devices switch fully on or off, rather than operating in linear mode. The signal is converted to a series of pulses. It has been argued that the devices can't switch fast enough to be suitable for HF use.
Class H is essentially a Class AB amplifier with a power supply that is more efficient. Behringer Europower and some other pro amps use this class.