Black box on Arduino unsoldered itself due to overheating
What exactly happened to cause this? 


It seems you short-circuited the power supply to ground.


  What is the black box that fell off


The item marked M7 is a surface mount diode. It is equivalent to the standard 1N4007 rectifier diode. I believe it is there to protect the board against the power being connected with the wrong polarity.

 Uno schematic

If that heated up and melted the solder, it is probably damaged. You could replace it with a new one.

However if that has been damaged, it is possible other parts on the board are also damaged. If you were drawing power from the Vin pin, the PCB tracks may have also overheated, but you may be lucky.