Consensus is when all participants of the network or blockchain come to terms on the validity of the block, making sure that all ledgers pertaining to a certain transaction are the same.Consensus can also refer to the Consensus Mechanism of how all the participants of the network or blockchain reach an agreed upon state of the blockchain.
The consensus mechanism is usually built into a blockchain’s protocol and this ensures that all participants in the network are aligned towards a common goal of producing new blocks and supporting and securing the blockchain. The consensus mechanism also includes penalties for bad actors in the system. Penalties can range from simple computing time lost for mining wrong or erroneous transactions in a Proof of Work system to slashing of tokens staked in a Proof of Stake system.
Research into consensus mechanisms has seen explosive growth as of late with lots of up and coming blockchains researching alternate consensus mechanisms to Bitcoin (BTC) that promise faster speeds, lower energy consumption and better security.