There are two types of wallets – custodial wallets and non-custodial wallets. The biggest difference between the two types of wallets is who has access to and control of the cryptographic keys that are used to sign transactions. With non-custodial wallets you own and control access to the cryptographic keys. With custodial wallets, a custodian like an exchange owns and controls access to the cryptographic keys. They have ultimate control over the coins in the wallet, not you.
Wallets visualize the cryptocurrency coins associated with your account. Contrary to popular belief, wallets actually do not hold your cryptocurrency coins. Cryptocurrency coins are stored on the distributed ledger (i.e. the blockchain).
A wallet allows you to use its cryptographic keys to sign transactions that take action (e.g., transfer to another account) on the cryptocurrency coins associated with your account. In other words, your cryptographic keys give you access to your cryptocurrency coins. Disclose that key to a different party and your funds may be transferred without your consent.