I've done this sort of thing a lot. Mostly to avoid overcharging, swelling, exploding batteries.
A battery connector can have other connections for a thermistor (or more sophisticated temperature measurement), a resistor to indicate what capacity/model battery is connected and sometimes real communication with a BMS.
Different device react differently. Some don't mind having no battery. Some notice that current only flows OUT of the battery, but never IN. In that case a stupid device will scratch its head and say, "Hmm, the battery is 4.2V but it never gets any electrons. It must be at 0%"