Definition
Leader election is the process by which a group of nodes agrees that exactly one of them holds a coordinating role — accepting writes, assigning partitions, or running a scheduled job. It exists because many problems are dramatically simpler with a single decision-maker, and the hard part is not choosing a leader but guaranteeing there is never more than one.
In practice this is delegated to a consensus protocol (Raft, Paxos) or a coordination service built on one (ZooKeeper, etcd, Consul), because rolling your own is a well-known way to produce split brain. The subtlety interviewers care about is that a leader cannot always tell it has been deposed: a leader partitioned from its peers may keep acting as leader while a new one is elected. The defenses are leases with expiry and fencing tokens — a monotonically increasing term number that downstream systems check so writes from a stale leader are rejected.
How it comes up in interviews
Any design with a coordinator invites "what happens when it dies?" and then "what if it comes back?" The second question is the real one. Answers that stop at "we elect a new leader" miss split brain; answers that mention leases, fencing tokens, and the fact that a partitioned old leader still thinks it is in charge land much better.