Hardware Attached on Top (HAT) is a circuit board with a size of 65 mm x 56 mm, which has mounting holes at the rounded corners. The mounting holes on the HAT board match those on a B+ board.
In the case of the Raspberry PI, the HAT board can be automatically configured by the autoconfiguration. The autoconfiguration is done via 2 dedicated pins. The EEPROM contains the board's manufacturer information, the GPIO setup and a so-called "device tree" fragment - basically a description of the connected hardware that allows Linux to automatically load the required drivers.