
Many earbuds have little metal pads that meet contacts in the case. Magnets or the shape of the pocket help line them up. The case can send current through those contacts so a charging circuit can add energy to the earbud battery.
Why are the contacts sometimes spring-loaded?
A small pin can move a little when the earbud seats. That helps it stay pressed against the pad despite small differences in fit. Even a small amount of dirt or a poor fit can stop a reliable electrical connection.
Is that the same as charging the case on a wireless pad?
The case may be able to receive power from a wireless charger. In that setup, the transfer into the case is wireless, while the earbuds can still get their power through the metal contacts inside it.
For more on how a connection carries current in a charging circuit, see Basics of Electric Utilities 101.