Electrum is a software code, open sourced, therefore tested by many. Nobody from electrum has an access to your private keys = to the passwords that can send the bitcoins.
With online wallets it is different. They are not open sourced and there is no 100% guarantee that the private keys are safe. It is really 2 very different things. When you are sending btc from online wallet, they must have somehow the private keys somewhere, otherwise it would be impossible to send the btc. Yes the private keys are secured, but it is the third party who has it.
If you are using electrum everything is inside of your computer.
There are also other cases. E.g. imagine that affiliates will be marked as criminals. Then imagine FEDs will seize your computer. They might not even get access to your online wallet, but it is enough for them to know the wallet. Then they can bring some case to court and the online wallets are just companies that will comply with giving access to your bitcoins (I guess this must be the case how up and there bitcoins are seized). If you have btc in your own wallet with strong password, they might even know the addresses but there is no way for them to get the bitcoins. I guess the software wallets are the most secure way to store propert ever.
If you talk to God, you are praying; If God talks to you, you have schizophrenia.