Something was drawing too much current for a long time, or that connection started to degrade at some point, both will cause the connector to heat up.
You may or may not have solved the root problem.
It wouldn't be a "spike" at start - melting that requires a pretty continuous current draw or a failing device down stream (it could happen pretty instantly, but that generally releases a bit of smoke, some fireworks, and a smell of burnt plastic, and the device that drew too much current would likely be toast too).
The alternator (generally) only draws as much current as needed to generate the requested output voltage/current, and that draw is directly from the battery connection on the starter with a sizeable wire.
Re-reading, I'd suspect the connection was weak for some time and kept overheating (due to increased resistance there), slowly making the plastic brittle until it worked loose.
I don't envy the chasing you had to do to find the problem, what a pain!