to a layman it’s probably best to just… not really think too deeply about this, there is layer upon layer of possible nuance and yet at the same time 99% of the time it’s as simple as “if the ‘thing.otherthing’ isn’t identical then they have absolutely nothing to do with each other”.
To really understand what’s going on you’ll need to dive into how computer networking functions and a bunch of other things, which i do highly encourage since it’s good to know, but the important thing here is that you’re talking about domain names, which i’m not going to try to explain further but rather recommend you look up on wikipedia and other places to learn more about.