engines consider folders part of the same domain, hence the keywords has to be related, while subdomains are considered as different entities altogether, hence they can have totally distinct keywords altogether, but effectively both are search engine friendly
1. Sub-Domains: These are consider seperate sites in the eyes of search engines, you would only use this if you wanted to create another site ontop of your current domain name. 2. Folders: These are consider part of your site in the eyes of search engines, they are just different sections per-say of your website.