They are stores that have to pay taxes, respect and comply with the laws, and reach agreements with the developers to sell their games. Basically the same thing that any company does that wants to sell third party products.
Stores or marketplaces such as G2A, CDKeys or Eneba are established in countries with a lax legality to operate without worrying about laws that protect users or developers, although they may have cheap prices after they compensate it with extra fees, shields that do not protect, charging for inactive accounts or even stealing game keys from developers.