In the simplest terms, mining is the process of hashing the block header repeatedly changing one parameter, until the resulting hash matches a specific target. The hash
function’s result cannot be determined in advance, nor can a pattern be created that will produce a specific hash value.This feature of hash functions means that the only way
to produce a hash result matching a specific target is to try again and again, randomly modifying the input until the desired hash result appears by chance.In this highly competitive environment, individual miners working alone (also known as solo miners) don’t stand a chance . The likelihood of them finding a block to offset and their electricity and hardware costs is so low that it represents a gamble, like playing the lottery.
Source-
https://cryptocomes.com/wikicoin/what-will-happen-when-all-21-million-bitcoins-are-mined