Your battery powers the 12v system when you’re not plugged into shore power/generator. When you are plugged in, your battery supports your converter (makes 12v from 120v) and that converter acts as your battery charger.
On Most of the Time
You basically want to leave the battery disconnect in the ON/connected position when the camper is in use – either plugged into a campsite, your house, or connected to your truck/tow vehicle. You want it plugged in so that the batteries continue to charge.
Off for Storage
You want to disconnect the battery (put it in the OFF position) when the camper is being put away for storage. This is because there are parasitic draws on the camper that can run a battery flat in a fairly short period of time (couple of days or less with the stock battery from dealers).
Important Note for Trailers
For trailers, your batteries very most important job is to provide power to your brakes in the event your camper catastrophically detaches from the truck/tow vehicle. The emergency breakaway pin gets pulled and it locks the brakes on the camper. Always make sure the battery is connected when towing. It’s possible the wiring for the brakes bypasses the battery disconnect but just connect the battery and there’s no guesswork.