To understand how cryptocurrency wallets work, you first need to understand what public and private keys are: strings of numbers and letters generated by cryptographic algorithms that can be used to encrypt and decrypt messages.
The public key acts as an "address" that can be shared with the public, and the private key is used to create digital signatures, decrypt messages, and prove who owns the key.
In terms of blockchain, public and private keys are used to maintain balances: the public key is used to generate wallet addresses, and the private key is used to sign transactions and verify ownership.
So what are wallets used for? A crypto wallet can be thought of as a "keychain" rather than a traditional wallet. It helps generate and store key pairs, and is the interface through which you interact with various DApps that require transaction signing.
You may have noticed that the wallet requires you to store a "seed phrase" rather than a private key. First introduced in BIP-39, developers found an easier way to represent an account's private key — a dictionary phrase of 12 to 24 words rather than a string of letters and numbers.
Also, a seed phrase can be generated from multiple keys and is cryptocurrency agnostic, allowing multi-coin wallets like Trust Wallet to store an entire portfolio at once, allowing users to create multiple accounts and still keep track of just one seed phrase.
Overall, a crypto wallet acts as an interface that holds public and private keys - it doesn't actually hold any crypto assets in your account.