If there's margin to be had, the first step is having customers.
AWS was the clear leader, and sure, you can try to attract different customers... but they should have also tried to make it as easy as possible for existing AWS customers to migrate.
Then, you offer your customers additional services that the other guy doesn't offer.
Your question is basically how does hosting a quarter of the internet make money, well Amazon benefits a mil+ an hour in profit off AWS margins... plenty to entice Google and Microsoft to compete.