Consensus algorithms allow distributed systems to agree on common values despite potential failures. Paxos is a consensus algorithm that allows a group of processes to agree on a single value among them despite potential process failures or lost messages. It works by having one process designated as the leader to propose values and other processes vote on those values to decide on a common value.