It's all about management cost. How much does it cost to operationalise your own server farm with the same guarantees you can get from a cloud vendor? Do you have the necessary expertise on infrastructure/SRE to have team(s) deploy and operate your own server farm with the production level your business require? Do you have a good hiring pipeline to supply you candidates with the required expertise when the time comes to replace your experts? Is that a business risk worth taking if it's not your business' core business?
For example: I use Elasticsearch and have used it for the past 10 years, I have deployed ES clusters myself, I have been a team lead for infrastructure teams that had to support a ES cluster, etc. I would never, ever, choose to do it myself again if I can find a managed solution. It's a lot cheaper when you factor in that you will require at least 1 engineer with expertise (or being trained for it) to properly support a running ES cluster in production.
The same applies for databases (I've managed shards/clusters of Postgres and MySQL in my life), and Kubernetes clusters, and any other piece of infrastructure that becomes critical to your business, you have to manage it and therein lies the majority of the cost of any solution: supporting it. The cloud provisions, manages, backs up, fails over, etc., without intervention from my side. Yeah, I can set up all of that myself but that is another cost to take into consideration, and something also to be maintained over the years.
Yes, I can find open-source tools for a lot of issues in software engineering, I can't find anyone to run those tools for free, so the trade-off analysis is based on this when looking into solutions, and a lot of the solutions from cloud vendors is exactly managing resources for me and my teams.