I believe you are confusing some concepts here. There's more than just two kinds of crypto wallets out there. For starters, you've got paper wallets and other types of physical wallets too.
Hardware wallets are definitely among the most secure. They keep your private keys offline so your coins don't get hacked or hit with malware. But most hardware wallets still need some kind of software to work, whether on your computer or smartphone. Like you can use a hardware device with the Electrum wallet for example - thats a a non-custodial software wallet by itself. And get this - not every software wallet needs an internet connection either. You can download Electrum onto an offline device to sign transactions without ever going online. Much more secure. I also think it's confusing when exchanges get lumped into the wallet category. Thats not their primary purpose.