There are organizations that are called registries that manage each TLD option. When you register domain names, you would first visit a domain registrar who would in turn check with the registry that manages that TLD to see if the domain is available. If the domain for the TLD you want discovers that it is in fact available, the registry adds it to their registry and gives you access to it. If the domain has already been registered by another user for that TLD, you will be shown during the domain registration process that the domain isn't available.
Domains are nonmaterial goods. When sold, the only transaction taking place is transfer of domain rights from one user to another. Barring any form of copyright or trademark violation, virtually any domain name can be bought or sold. Generic domain names, such as car.com or computer.com, are not legally protected and can therefore theoretically be reserved by anyone.
The way that competition is supposed to work between registries, is that lots of companies go to ICANN and say “We think we can reliably manage .com, and we think it would cost us [$5] per domain.” ICANN reviews these bids and awards the .com contract, which lasts for a fixed period of time, to whomever they deem best-suited to the job. In this time, other companies can think of ways to manage .com better/cheaper, and try and win the next contract. This, in theory, would provide an incentive for registries to innovate, a big part of which would be in lowering costs.
A domain name is an identification string that defines a realm of administrative autonomy, authority or control within the Internet. Domain names are formed by the rules and procedures of the Domain Name System (DNS). Any name registered in the DNS is a domain name. Domain names are used in various networking contexts and for application-specific naming and addressing purposes. In general, a domain name represents an Internet Protocol (IP) resource, such as a personal computer used to access the Internet, a server computer hosting a web site, or the web site itself or any other service communicated via the Internet. In 2017, 330.6 million domain names had been registered.
A great domain name is a concise, easy to type, and memorable URL that reflects your brand or your website’s subject matter. Avoid using hyphens, strings of numbers, or unnecessary words to make it easy for your visitors to remember and find your website. Remember: A great domain name is one that your visitors can type correctly on their first try.