Because most of Amazon's profits come from AWS (74%). So I would say it's more like comparing Google or Oracle to Apple than you think.
Because capitalism is efficient, and because there are lots of dollars chasing the Lock-in Problem, and moreover because AWS is the market leader, it has an enormous amount to lose. Even if 0.5% of the aforementioned startups succeed in reducing dollars lost to lock-in by (say) 10%, on average, that's billions that AWS stands to lose. (By my armchair math)
The market prices these risks in.
It reminds me of this:
https://www.atlasobscura.com/articles/butterflies-parasitic-... "These Butterflies Full of Wasps Full of Microwasps Are a Science Nightmare"