Like Bitcoin, Monero relies on two important infrastructure elements: nodes and miners.
Nodes simply store a copy of the blockchain. They communicate with other nodes and wallets to process these transactions. It is important to run your own node if you can, since it offers the best security and privacy.
Miners keep the network secure. For each block, the network generates a new problem that will be solved every two minutes on average. Miners use their resources in an attempt to solve this problem. The faster the computer, the more attempts it can make every second. When a problem is solved by a miner, the network awards this miner the block reward and any transaction fees. To reduce reward variability, most miners join their hashing power together into pools, which then fairly split the reward among those who contributed.
Monero uses a different mining algorithm than Bitcoin called CryptoNight. CryptoNight is purposefully ASIC-resistant and is meant to work with typical consumer hardware. Even CPUs are still competitive.