is a sump basically just an enclosed container full of water in which you can stick things such as protein skimmers, heaters, and other equipment or is there a theory behind it?
That's pretty much what it is. A sump basically serves a few purposes (IMO):
A place to put equipment out of sight, as you mentioned above.
Increased water volume (allowing for more stable water parameters)
An place to keep additional LR for bio-filtration
Also, having a good "return pump" between the sump & display allows for needed water turnover, exhange, current, flow, gas exchange, etc.
Our sump is a 100g Rubbermaid stock tank directly below the display in our basement. We affectionately refer to it as "Dexter's lab". There is about 150lbs of LR in it, and it is home to a DIY skimmer, DIY Calcium Reactor, DIY Nilsen reactor, as well as heaters, temp probes, pH monitor probe, etc. etc.
Btw, most sumps are not this complicated. When we had the 75g tank, our sump was simply an Acrylic DIY 20g container underneath the tank stand, which housed a skimmer and heaters. ;-)
HTH!