At its most simple a frame keeps all your parts in the right place. Back in the day, the guys at Flite Test made them out of wood! Things have moved on (a lot!)
The size of a frame is determined by the size of props it can spin, 5" being the most common.
Race frames typically carry the battery underneath where freestyle frames tend to have the batter and a GoPro mounting on top but nothing is set in stone.
Frames are usually made of high-quality carbon fibre to be light and strong but things do break which is why we carry a range of spares.