A hardware wallet is a physical device that handles your wallet's private keys. This provides an extra layer of security by isolating your keys from your computer; as a result this reduces the risk of being hacked. In the case of devices such as Trezors and Ledgers, signing of transactions are handled externally and also encrypted.