Lots of reasons. Could be selling data, advertising, or some are just freemium, and some support for 24/7 uptime needs.
Some are VC funded to get off the ground with no business revenue plan yet until user growth.
Not as simple as just 'you are the cost'.
Redhat is free, so is MySQL. Same with Ubuntu. They aren't selling your data or other stuff. They make their money off enterprise projects and support contracts.
Then look at FOSS. Bitcoin core and nostr apps are free....
Just my 2 cents