While a page is uncustomised (previously known as unghosted) it is stored on the file system, however once it is customised (previously known as ghosting) it is copied to the DB. Source 1 and Source 2
What I would like to understand is how SharePoint handles the versions of the customised pages within the database?
My understanding is that major versions are stored entirely, i.e. all the page data is stored in a single record, while with minor versions only the difference is stored. When a page is requested it gets the latest major version and takes each minor version after that and applies the changes until it has the latest version of the page.