Clarify: Which end of the cable is that? The end that plugs into the charger or the end that plugs into the kindle? You said that the cable lies around behind the night stand and that you discovered this when you pulled "it" out, but you didn't specify that "it" was. Was "it" the charger, the cable, the charger end of the cable, or the kindle end of the cable?

If it's the end that plugs into the charger, then yes, the charger failed, and you need to discard it and the cable. Perhaps water got on the charger, either from leakage/condensation in the house, or from a water spill on the nightstand?

If it's the end that plugs into the kindle, then it's possible that something shorted out the power pins on the kindle end of the cable while it was lying around behind the night stand. For instance a small piece of metal or other conductive material got into the end of the cable and laid across the power and ground pins.

It's also possible that the kindle end of the connector failed in such a way as to cause the pins to touch each other directly. For instance if the plastic in the center of the connector had cracked, split, or chipped, and that allowed the power pin to bend and touch the shroud or to touch another pin. Lying like that over time would slowly build up heat and cause the melting you observed.

No matter how it happened, though, you can no longer trust the charger, and obviously you need a new cable too.
_________________________
Tony Fabris