What miners are actually doing
Mining is often described vaguely as 'solving complex math problems,' which makes it sound more mysterious than it is. In practice, miners take a batch of pending transactions, bundle them into a candidate block, and repeatedly try random numbers, called a nonce, hoping the resulting hash of the block happens to fall below a target value. There's no cleverness to this, it's brute-force guessing, and the only way to find a valid answer faster is to have more computing power than everyone else combined.
Whoever finds a valid nonce first gets to add their block to the chain and receives newly created bitcoin plus the transaction fees inside it, as a reward. Everyone else on the network can verify that answer instantly, checking a hash is fast even though finding one is slow. That asymmetry, hard to find, easy to verify, is the whole trick behind proof-of-work.
