IN layman's terms, a battery selector allows you to determine which battery to use either 1, 2 or both. The positive wires from the batteries assuming you have a dual bank, are attached behind the selector to 1 and 2. Then the common which is a positive wire goes to the 12 volt distribution panel and/or engine starting. Sometimes there is an on and off switch for the wire going to the distribution panel and /or engine.
Many usually determine which battery they will use strictly for the engine and the other for the cabin, running lights and so forth. Why? If you are running both batteries for the cabin and so forth without charging them, they will run down thus not allowing you to start the engine as it takes current to turn the engine over before starting. Many times I had to take a rescue boat for a start jump for the engine. Therfore, you may want to designate one battery solely for the engine.
Charging comes from various sources but the two primary are engine assuming inboard diesel in this case and shore power. Generally the shore power charging is wired up to both battheries direct and has what I call a float switch when it senses the individual battery being fully charged will stop charging. As for the engine, It will keep charging the battery or batteries and that is usually determined by what the battery selector is in. For example if on both, the both batteries will be charging but only say in #1 position, that battery only will be charged.
I use to instruct my clients to shut off the shore power charging to the batteries when leaving the boat going home for any length of time so the batteries will not be "cooked". Believe it or not, continuous charging without using the batteries does shorten the life of the batteries and if you are doing that, suggest that on those batteries where you have to keep the fluids level up, you better check that on a routine basis.
Hopefully this will help