1977 Jeep Cj 5 renegade 304

There is a ground wire going from the negative terminal to the engine firewall. When unattached the jeep won’t start no head lights etc….
Recently the wire stated getting hot and burnt ….
Question is this a factory wire or is this a work around fix from a earlier problem I’m not aware of ?
The negative large ground terminal wire is grounded on the engine block ….I put a heavier gage wire on it and it seems to be no problem …I just want to make sure this doesn’t start a fire or something …