I would also agree on a loose coneciton...BUT... I noticed the cable to be a Euro-cable/cord. I can't remember the Euro color code for hot and netural; it might be worth checking into.
Thinking out loud; the device and cord may have been rated for 220V...110 will double the amperage and may overload the plug body. (15 amp plug on 20 amp circuit)
That plug was NOT original to that cord.
The cord appears to be from an IEC computer cord. The type with one end that plugs into the back of a computer with an IEC C13 connector (the computer would have a C14), and a NEMA 5-15 connector MOLDED onto the other end.
That's a replacement plug.
The International wiring ICC color code states that blue is neutral, and brown is line, and green with a yellow stripe is ground, SO, that plug has it's polarity reversed.
That's not the cause of the melted body though. That's caused by a loose connection. That plug is easily capable of handling a sustained 20A load, whereas that wire appears to be only 16 gauge, so if the voltage (and therefore current) were too high, the wire would surely have melted first.