In regardsa to metadata, take a look at the "Information Schema" in the documentation.
As far as the table creation... When a table is created, it is assigned a table OID (Object ID) number, which is a 32 bit integer, and which can be found in the metadata. That integer is then used in creating the file which contains the table data. The location of the file is determined by the tablespace which it is assigned. The tablespace is, of course, a named folder path.