The consensus is a fault tolerant mechanism used in blockchain and other distributed systems to reach to an agreement to add or commit a transaction to the database by all the participating nodes.
Consensus mechanisms makes a distributed system truly trustless.
Centralized distributed systems achieve consensus under the fail-stop assumption. This requires that the distributed system agrees on a value in the face of node and link failures but not if a node behaves maliciously.
Decentralized systems are required to operate under Byzantine node failure where a failed node may act maliciously, i.e., they may not respond, or they may send incorrect information.