I could give you a very detailed technical explaination

Will try to keep it simple
porn.com
is a top level domain
for every single top level domain you are able to register unlimited subdomains, like:
xxx.porn.com
a very common and most used subdomain is the www.porn.com
such as we use forum.cdrsoft.cc

So, the DNS (domain name server) for your domain, stores all the info about your domain. Like IPs, subdomains and so on.
If I would only setup the DNS for www.cdrsoft.cc, the site wouldn´t be accessible ..
wit cdrsoft.cc for example.
There are wildcards of course like *.cdrsoft.cc

So what we do is:
directing forum.cdrsoft.cc to this place ...
and all the rest *.cdrsoft.cc to the main site itself. You may check by using iamnothere.cdrsoft.cc or something like this.
so if you try to access a page like porn.com and they didn´t setup their DNS with wildcards or something you might get a Error 404 message. www.porn.com will work ..
so

www.porn.com -> Top level domain (TLD)
xxx.porn.com -> Subdomain
So it is just a setting of the DNS for the particular domain.
IF you got questions, just shoot
