Yeah it can get really confusing. Here's the concept. Each Root domain can have many subdomains, as well as sub-folders.
Any link pointing to any subdomain or subfolder will provide some linking value to the entire root. It's not as much as that individual subdomain or subfolder gets, however the cumulative impact is there and it's real.
The reason is pretty straight forward - any sub, (domain or folder) is naturally associated with the root. It contributes to the overall weight of that root.
It's not unlike the branches of a tree. While the rain may fall directly on a branch, some of the water has the ability to work it's way back to the main trunk of the tree.
Just like water that seeps into the ground and soaks into the roots, can and will work it's way up the trunk and to the branches.