A private key in crypto is like a secret passcode that unlocks a vault containing digital assets.
The vault, in this case, is actually an entry on a blockchain showing an amount of assets controlled by an individual address.
While anyone can see the contents of the vault using freely available tools such as block explorers (the public/transparent nature of blockchains make trust-minimized transactions possible), only the person holding the private key can actually access the assets to send them to a different address.
A private key is created every time someone creates a new crypto wallet. Put another way, a crypto wallet has the sole purpose of creating a private key.
Private keys are cryptographically created to allow one-way access and are necessary to create part of the signature process that is necessary to interact with blockchain-based assets.
Another function of the cryptography underpinning the private key is that it also makes it possible to associate the private key with a public key — and the combo together is what actually makes it possible to move assets from one crypto address to another.
Sometimes the term private key and seed phrase are used interchangeably, but they are slightly different. Most hardware wallets will generate a seed phrase and the user will never actually see the private key. Other kinds of wallets, however, do allow users to see their private keys.
Crypto security best practice entails safeguarding a private key and/or wallet seed phrase to ensure long term wallet integrity.