Nakamoto Consensus
Nakamoto consensus is defined in the Bitcoin whitepaper as nodes voting to enforce rules.
It is a Byzantine fault tolerant consensus algorithm that utilises the concept of Proof of Work and economic incentives.
In short, it defines an honest node to be a node that adopts the longest chain to its knowledge and build the next block that extends the longest chain. By choosing which chain to build upon, the node has effectively voted for the rules that is implied by the chain.
Given the consensus, the proof of work in the longest chain creates an economical and technical barrier for any attacker to overcome. At the same time, the block reward as an economic incentive drives the node to follow the consensus.
The security of the consensus has been studied by academia and tested by the reality since 2009.