Firstly, apple doesn’t compete on price. Even if icloud is priced more than google people would always buy apple just for the ecosystem integration. It’s not even a competition to be honest.
Look up “buy or build” which is the industry term for this kind of evaluation: buy product and use it/resell it or build your own.
Apple has gone for different strategies in various areas:
Build own Apple silicon chips, do not buy off the shelf chips from intel or nvidia or amd.
Buy and resell google storage but don’t want to build their own distributed data store for end users.
It’s about what matters more for the company and the core products. Apple’s laptops, cell phones are considered core products. Icloud is a value add.
This is also why apple is making their own cell phone broadband chips. For most companies, this is a “buy from qualcolm” but apple needs to build their own for independence for their number 1 core product: the iphone.