The two kinds of network
A blockchain usually runs more than one network from the same software. The mainnet is the live one: the coins on it are real, and transactions there are final. Testnets are parallel networks that developers use to try things out without risking money. The Solana documentation, for example, describes mainnet as the live production environment where tokens are real, devnet as the place for developers to experiment where devnet tokens are not real, and testnet as a place to stress-test upgrades and validator performance where tokens are also not real.
Why test networks exist
Software that handles money needs testing before release. On a testnet, developers can deploy contracts, simulate heavy use and try upgrades, and users can learn how a wallet works. The tokens are often given away free by a faucet, because they have no value.
How they are separate
A testnet has its own blocks, its own history and its own addresses in some cases with different prefixes. Test tokens exist only there and cannot be moved to mainnet. Likewise, real coins sent to a testnet address are lost, and test tokens received on a mainnet address are worthless. Many wallets let you switch networks, which is useful for developers and a hazard for everyone else.
Staying safe
Before sending, check the network name your wallet shows. Do not buy or accept 'testnet tokens' as if they were an investment; selling them is a common scam, because they have no value. If you are experimenting with a wallet, use a testnet or a tiny mainnet amount, and never use test networks for real balances.