Like it's fine if they sell their game on Steam for $40 and another store for $60 as long as the thing on the other store is for that platform and not a key to activate it on Steam.
They just want the price of a game that's on your Steam library no matter the source to be the same no matter where you purchase it.
That is my understanding. Additionally I have seen no evidence that it is actually enforced either. You could get Ghost of Tsushima for $59.99 on steam and for like $51.xx on another site using keys. Same happened with forbidden west.
The agreement is only between the dev and Valve; 3rd party key sellers like G2A or Eneba usually obtain their keys through trades, buying them from the original seller, or by stealing them (which is an entirely different can of worms). They're entitely user-driven marketplaces selling second-hand merch.
Doesn't even have to be sketchy resellers like ones mentioned like g2a. Normal ones like fanatical and humble bundle sell cheaper. Those aren't user driven market places.
Just have to take a look at isthereanydeals which anyone should do before buying a game.