A GFI protects people from shocks by sensing low current (5mA) ground faults. This cord got real hot from an overload or loose connection. A GFI probably wouldn't have helped.
Discussion
Any way to prevent it? It was plugged into the wall directly.
I'd start by replacing the cord and receptacle. It was probably a loose connection, creating heat, makibg the connection looser. Make sure everything is rated for the current you expect your device to draw. Then measure how much current it is actually drawing to make sure it is working right.
Thank you sir