Why do headphones have better frequency response than speakers?

Loudspeakers don’t come close to offering the full frequency range that headphones do. Why is that?