There are automatic "solenoids", simple solenoids, and then there are diodes.
Diodes come with a cost, they have a small voltage drop and that small drop means that your camper battery will never reach a full State of Charge (SoC). Neither will your starting battery unless the regulator is set for a different charge voltage - which is something few can do.
Simple solenoids use an ignition position source to turn on. The downside to this is that if you've just started the engine it's alternator will need to not only immediately recharge the starting battery, it will also need to immediately recharge the camper battery. Few automotive alternators are made to work that hard for that long, so alternator life-span can be shortened.
There are basically two kinds of automatic relays or solenoids. They come with the names of "Automatic Charge Relay" (ACR) or "Voltage Sensing Relay" (VSR). Some of these wait a predetermined amount of time before connecting the camper battery to the TR's charging system. Others wait until the starting battery SoC is high enough that it is nearly fully recharged before connecting the camper. This way the alternator isn't working at full capacity for a long time. Be careful though, some of these units will not connect if the camper battery voltage is too low.
Some of these units are also "dual sensing" meaning that if either battery is getting a charging voltage (say in the case of solar
on the trailer) and is nearly 100% SoC the unit will close and allow charging of the other battery!