The wire between the truck engine compartment, all the way back to the trailer battery, is almost always of insufficient size to effectively keep the trailer battery charged if you are drawing any kind of a load in the trailer. This wire is usually 12 gage or smaller, and the total length is probably close to 30 feet in a lot of cases. the voltage drop across this length, even at a 10 amp draw, is enough so that the trailer battery will become discharged. It requires AT LEAST 13 volts to fully charge a battery, and with only a 2 volt drop you only will have 11.6 volts available at the end of the wire, assuming a typical 13.6 volt output from the truck alternator.
The solution is to rewire using at least a 10 gage wire, preferably 8 gage. This is not easy to do, but it is the only way to assure full charging of the trailer battery when you are drawing heavy loads while travelling.