A consensus protocol (for blockchains) is the way in which the participants in the blockchain (also called nodes) come to an agreement about what the next valid block is. This is governed by a commonly agreed upon set of code which automates the process and is executed by each node.
For further details see: