As with other relational database systems, SQL Server exposes metadata about your databases.
This is provided through the ISO Standard INFORMATION_SCHEMA schema, or the SQL Server-specific sys catalog views.
INFORMATION_SCHEMA
sys