What are the advantages of class-B amplifiers?

Much better efficiency than class-A, that’s it.

Class-B is often used for radiofrequency broadcast amplifiers, where high power and low spurious RF emissions (sorry, no class-D in radio!) make it a great choice. On its own though, class-B suffers from relatively high (crossover) distortion and is unsuitable for audio.

When a little quiescent current is applied though, the output transistors are biased to stay on past the zero-cross point, and you then have a class AB amplifier. This dramatically reduces distortion and is what most proper consumer-grade hi-fi amplifiers use these days.