Three groups:
The Internet Corporation for Assigned Names and Numbers, the non-profit in charge of domain names.
Domain sponsors, the organization that agrees to provide the infrastructure for a particular top level domain. For example, .com is sponsored by Verisign.
The registrar you deal with has a license from the sponsor to sell registrations for a top level domain.
You pay the registrar, the registrar pays the sponsor, and the sponsor pays ICANN.