The lower storage Deck models have been sold at a loss, with the plan of recovering that through game sales. So rival hardware running SteamOS could make valve more money than the deck does.
It's possible that the deck's are no longer sold at a loss, both due to components getting cheaper over time and higher sale numbers leading to lower cost per unit. But either way the money comes mostly from game sales, not hardware sales.
I got it for travel and it really is a top notch portable gaming hub. Doubly so because emulation is really easy to set up and run through the frontend. I love being able to play Elden Ring on the go.