Bitcoin's consensus mechanism is PoW (Proof of Work). Simply put, the more you work, the more you get. The more computational work you put in, the more likely you are to be the first to find the correct hash, and the more likely you are to be rewarded in Bitcoin.