Software Engineering ยท Distributed Systems
When a cluster of machines needs one to be in charge, they run a protocol to automatically agree on which one โ and pick a new one if it goes down.
Example: A cluster of machines automatically picking one to coordinate the others.
In practice: Algorithms like Raft and Paxos exist specifically to make leader election safe even when nodes crash or messages get lost mid-election.