regclass and the other
reg types are “object identifier types”. As the documentation says:
oidtype is currently implemented as an unsigned four-byte integer.
The OID alias types have no operations of their own except for specialized input and output routines. These routines are able to accept and display symbolic names for system objects, rather than the raw numeric value that type
So it is just a convenience: it really is the numeric object ID, but is displayed as the object name.
regclass can be cast to numerical data types: then it will become the
regclass can also be cast to
text: then it will become the table name.