Bitcoin mining is usually pictured as some kind of digital gold rush, but the actual mechanism is closer to a very large, very public competition to solve a math puzzle. Here's what's actually happening, without the hand-waving.
Despite the name, miners aren't discovering bitcoins hidden somewhere. They're competing to add the next block of verified transactions to the blockchain, and the network rewards whoever wins that competition with newly created bitcoin plus the transaction fees included in that block. "Mining" is really "processing and securing the ledger," with new coin issuance as the incentive to keep doing it.
Every block has a target hash value it needs to produce. Miners take the block's data (a batch of pending transactions), combine it with a random number called a nonce, and run it through the SHA-256 hashing function. If the result doesn't meet the target, they change the nonce and try again, billions of times a second, until someone on the network finds a hash that qualifies. This is called proof-of-work: computationally expensive to produce, but trivial for every other node on the network to verify once it's found.
Difficulty is the entire security mechanism. Rewriting Bitcoin's transaction history would require redoing the proof-of-work for that block and every block after it, faster than the rest of the honest network can extend the real chain, an effort that scales with how much of the network's total computing power you'd need to control. The network automatically adjusts the difficulty roughly every two weeks so that a new block is found approximately every 10 minutes, regardless of how much total mining power joins or leaves the network.
Modern Bitcoin mining is done almost entirely on ASICs, application-specific integrated circuits built for one purpose: computing SHA-256 hashes as fast as possible. Individual miners typically join mining pools, combining computing power with thousands of others and splitting rewards proportionally, since the odds of any single small miner finding a block alone are vanishingly small at current network scale.
Bitcoin's block reward started at 50 BTC in 2009 and cuts in half roughly every four years, an event called the halving. It's currently 3.125 BTC per block following the 2024 halving, heading toward 1.5625 BTC at the next halving expected around 2028. This is what creates Bitcoin's fixed 21 million coin supply: the reward keeps halving until new issuance effectively rounds down to zero, expected to fully complete around the year 2140.
Every Bitcoin private key that will ever exist is generated right here on this site, Satoshi's included. Try for a million years. You still won't find a funded one.
Try the key collider nowMining and private key generation are separate processes that happen to share the same underlying cryptography. Mining secures the transaction ledger through proof-of-work. Private keys, generated independently for every wallet, prove ownership over funds on that ledger. Understanding both halves is the full picture: mining is how new coins enter circulation and the ledger stays secure, private keys are how anyone actually owns and controls them. For what that ledger actually looks like structurally, see what the blockchain actually is, or for how a transaction moves from your wallet into a block in the first place, see what happens when you send Bitcoin.