Paul Kafasis on the Rogue Amoeba blog, on a neat trick provided by Apple’s T2 chip:
On older Macs, the headphone jack and the internal speakers are essentially separate ports on a single output device, and only one of these ports is allowed to be active at a time. Because of this, audio can be sent to either the built-in speakers, or the headphone jack, but not to both. As well, if anything is connected to the headphone jack, the OS shuts off the built-in speaker completely.
With these new Macs, there are actually two distinct output devices. The headphone jack and the internal speakers are separate devices, completely independent from one another.