You need to determine which lead is to supply equipment and which goes to the chassis ground, before you do anything else. If you connect them backward you will have a reverse polarity and you may do major damage to things in your RV.
View attachment 2503754
This shows the proper wiring for two 12V batteries connected in parallel to supply an RV, properly. That third wire is probably from the solar system, as Ex-Cal suggested but, you should get out your multimeter and check the voltages and polarity. With the large cables lifted off of the battery, you can measure each one to the chassis and one should show nearly 0 ohms while the other will have a very high reading. The one with 0 ohms should be on the negative battery post, the other on the positive battery post. I suspect that the third wire is from the solar panels as suggested by Ex-Calif, but I would not address that until you know for sure that the batteries are properly connected.