CMS, as its name, use script and database to manage content/information. A good example is this forum. All posts and topics, as well as codes and blogs are kept in database and using php script to draw the information, when requested.
In many websites, the programmer tends to use cms to make the site easy to update and allow the owner to add new information from time to time. Like you pointed out, you can use database to keep links, and when requested, display the links in the user defined format.
To build a cms for a website, all you need is good knowledge on scripting language (such as php and asp) and database design. Once you master these two, the limit you can do with it is (almost) up to your imagination and creativity. Of course, there is limitation on different database systems (such as MySQL, MSSQL, Oracle).
I developed a CMS for my Store2Go site where information of all stores is driven by databases. The owner of the stores can update whatever they like through an interface (the control panel).