The switch is to turn off something when you plug into the socket.
These are usually used on stuff that may be powered from batteries or mains. There is some sort of external transformer, reducing the mains to a similar voltage to the batteries, and the power comes to a coaxial plug.
One battery connection, usually the negative, is connected to the switch. When nothing is plugged in the switch is closed and the battery powers the unit.
When the transformer is plugged in, the switch opens and the transformer powers the unit, but does not charge the non-rechargeable batteries.