Sub domains, like addon domains, can also be set up to be redirected to a subfolder of your main website. One advantage of using sub domains is that you don't even need to register a new domain. If you already own www.mydomain.com, you can setup subdomain.mydomain.com with your hosting provider without involving your domain registrar.
Even if you are using a separate addon domain, it is often necessary to setup a subdomain for it to work. This means that your addon domain (www.addondomain.com) is first forwarded to addondomain.mydomain.com, which in turn is redirected to a sub folder like www.mydomain.com/addondomain. Hosting provider's control panels sometimes do this automatically, but it is good to know this so you don't get confused.
As with addon domains, also subdomains can be configured to always show the url of the subdomain and never reveal that the website is located in a subfolder of your main site. Not all website hosting providers offer subdomains that work like this, but it is getting more and more common all the time. If your hosting provider offers addon domains which show the url correctly, your subdomains will also work properly.
Some domain registrars
also let you setup subdomains, but I haven't seen one that would show the url properly. As with addon domains, it is better to set subdomains from your hosting provider's control panel than from the domain registrar.
Webhosting - multiple domains, multiple websites