The diode(s) conduct current in one direction only so a load on one battery doesn't discharge the other. Some have a switchable mode that allows current to flow back through the unit if you need to use the second battery to start your engine if the starting battery is discharged.
There are a lot of different units out there. The biggest thing to watch for is the voltage drop across the diodes (or other devices) which reduces the voltage to the battery when charging. Voltage drop means a possibly less than fully charged battery and also means more heat so a bigger heatsink is needed. Every isolator is going to give some drop, but some have a lot less than the approx. 0.7 volt drop of a regular old diode. That may not be a big deal for an accessory battery if you don't need to use the maximum available capacity.
Do your homework before deciding which to buy. There are a lot of units and more things to consider than I can cover or could explain adequately.