Domains are the user friendly nomenclature related to the location/address of a websites' resources. They were invented as a human readable solution to the complicated addresses required to find and display a websites files. For example, it's much easier to remember a domain like http://lunchlady.co than it is remember an IP Address like 192.168.2.1, which is what may be the actual address of a server. Think of it like the way you might refer to a store, you might say, "I'm going to the mall" rather than, "I'm going to XYZ Raspberry Lane." Saying "the mall" is a human friendly way of describing a location, while your mapping app/computer would then find the actual address and send you there. Similarly, adding a domain in the URL bar is then processed by your browser and connected to an actual address to send you towards.
Domains have what are called "extensions" after their name. These extensions help associate the name with a particular group, or at least that's how they were originally designed. For example, the ".com" extension was meant for commercial use, while ".org" was meant for organizational use. There are hundreds of extensions and most are publicly available for anyone to purchase.
Purchasing a domain is not the same as purchasing a location to host your website, they are two different services.