That is a Battery Grip.
It has four functions:
1. Allows holding of two batteries for longer shooting period.
2. Some of the models allow the use of 6 AA batteries with a Battery magazine, in case of emergency.
3. Importantly, it allows better grip, especially when holding the camera in the vertical orientation.
4. For users of longer, heavier lenses, it balances the whole set up so that the holding is better, and shake is reduced.