PostgreSQL Backend Flowchart
Databases seem to be treated like huge complicated black boxes, where you throw data, and have no idea how to get it back.
The real world database are pretty simple. These are just programs which parse queries, read some data from files, change the data and save it back.
Here is a simple flow chart with many links to source code about the way PostgreSQL backed works.