All of their games (Dota 2, CS, and the other ones they hardly maintain anymore) are basically just passion projects at this point, lingering on from a bygone age when they were a game development company.
Their most recent title, Half-Life: Alyx, probably only got greenlit because someone internally was able to convince leadership that it would help sell VR headsets.
In any case, my point was not that these games make no money, but simply that Valve doesn't need them. The total number of people buying games on Steam vastly dwarfs the number of people who play Dota 2 and CS2 (even just counting total players - how much more when you narrow down to players who spend money).