Coinbase doesn't provide you any private key for your walllet. But blockcahin provide private key so blockchaian is more safe than coinbase wallet.Also remembered,Coinbase is not a wallet,Its just a exchange platform.
Online wallets providing you with your private key doesn't automatically make them safer than those who don't.
Those services who do provide you with your private keys just understands better that people at all time need to have the option to access their funds in case their service for whatever reason isn't accessible.
Also, Coinbase has a multifunctional purpose, so it's definitely not just an exchange. People, and especially services quite often use it to exchange funds instantly and for free with others having an account there.
All to avoid having to pay network fees. Coinbase isn't the only wallet service doing so, but by far the most popular option for people to go for, and that shows if we look at how much new users Coinbase gained this year.