Battery terminal came loose on 97 Honda fourtrax 300 and shorted out the electrical system

What exactly needs to be fixed when this happens?

Added (1). Fixed the problem. The wire did short the system because it touched metal. I bypassed the solenoid and it started, so that was the problem.

Engine

What terminal came loose, + or -?

Could be just the voltage regulator, maybe main fuse.

Obviously if one of the cables came loose from the battery, NOTHING shorted out and you just need to re-connect the cable. If the other end came loose, you may have discharged or damaged the battery. Charge or replace as needed.

A short or short circuit very often results in smoke or even fire because it results in excessive amperage. An "Open" circuit means a disconnected or intermittently connected wire or battery terminal. It is not uncommon for intermittent battery terminals to damage alternator diodes because without the battery in the circuit, alternator voltages can be too high potentially exceeding the diode reverse voltage or damaging the ECM. In the old days you could disconnect the battery with the engine running to test the generator but it is risky to do that with alternators.

Start with checking the fuses.

It would be a short of the battery.

That would cause violent chemical reaction within the battery and much heat. The battery case would probably deform.

You'd need a new battery.

-Engine overhaul mechanic and electrical system expert, since 1972