Several point may clear some of the questions.
One is the fire hazard and venting. The design is not open to keep any fire danger down!
If there were vents, that would let dust, dirt, bugs in and also let any small fire get out! So sealed is better as the chances of the wire heat from current is figured in and will not start a fire due to fuses/breakers to cut power when it reached a dangerous level!
But the current flow is not likely what caused the insulation, etc to melt. What is more likely is the arcing from a connection which was not solid. That arcing is much like an arc welder and no wires and few connections will stand up to an arc welder!
Consider what arc welders can do to hard metals like steel and you can see that the easier melting/softer copper, etc will not hold up if heated to that point!
And that also brings in why solder is not a good idea on wiring. It is made of a combo of different metals which do melt at lower temps like lead! That leaves the idea of putting a metal like solder at a point which may heat as a really bad idea.
If you do any solder work, you may have noticed that you heat the solder and let it run between the strands of copper without that copper melting?
If we put solder on the copper ends, it does feel like it is more solid but when the idea is to keep a solid connection even if heated, the solder will melt and run before other parts. When that happens the end becomes smaller and the mechanical part of the connection is more likely to fail!
It becomes a death spiral as the heat at a somewhat loose connection melts the solder. That melting makes the connection even less secure and it heats even more until it really begins to arc enough to burn the copper itself out of reach of the arcing!
Notice how one wire is damaged much more than the others? That is often the one which was arcing the longest or worst! Notice the good thing is that the insulation itself did not support combustion and did not work it's way out of the safety of the metal box. There was nothing inside the box like paper or wasp nests to actually support a fire, so burning down the RV is not likely to happen as long as the box is closed and tight!
Why do the wires work loose? Several points can be a factor.
One is how much unsupported/ attached wire is involved. Keeping the wire that has to be loose to put in the screw attachments short is important. When we drive we put a lot of stress on any wires that are not well attached and the longer that loose wire, the more it can flop up and down! Every time it moves it deforms the end slightly and at some point it is no longer connected really solidly!
Think of the wire as being pulled on every time we hit a bump and the longer the loose run, the stronger the pull?
Short runs of wire make it harder to repair if it fails but short runs are more likely to last longer, so keep it short.
Then it is also likely that most wires we repair are not going to be torqued down to specs! DIY often skips some of those small points!!
Long wires, bumpy roads, screws not at correct torque and lots of years later, things can go wrong!
After twenty years, the gremlins do find a way!