What is consensus?
The Internet Computer uses a novel consensus protocol: the different machines, or replicas, must reach consensus on which inputs to process and in what order, so that they maintain a coherent state. Every piece of software is executed by many machines around the world instead of just one; the majority of the machines together define the true state of the software. If some individual replicas report a tampered state, have connection issues, or are even malicious, this will not make a difference as long as the majority of the replicas correctly execute the software.
Any number of replicas could be unavailable or malicious without affecting the correct state of the subnet as long as the majority of machines function correctly. This approach of using replication to gain security requires a consensus protocol. The subnet must process different messages, namely messages from users to canisters and from canisters to canisters. And they must all process the same messages in the same order, so that all replicas always end up in the same state—but each of the replicas that powers the subnet might actually see the messages in a different order. Therefore a consensus protocol is utilized so that all of the nodes that are powering subnets can agree on the order of the messages to process.
Learn more about consensus: