Explained step by step
A load balancer sits in front of the servers and hands out incoming requests, like the person at a bank who tells you 'go to teller 3'. That way no server is swamped while another sits idle. If a site gets 30,000 requests per second and each server handles 10,000, you need 3 servers, and someone has to hand out the work: that's the load balancer. If a fourth server is added, it starts sending it requests automatically.
Besides spreading work, the load balancer checks that each server is alive. If one goes down, it stops sending it requests and spreads them among the rest, like a manager who sees a closed checkout and sends the line to the others. Nothing happens for the user: they keep using the app without knowing a server died. That's why load balancing gives availability, redundancy (having spare pieces) and flexibility to add or remove servers.
Round robin is the simplest split: by turns, in a circle. Request 1 goes to server A, 2 to B, 3 to C, 4 back to A, and so on. It's like dealing cards around a table: one each, going around. It works well if all servers are the same and requests are similar; if one server is twice as powerful, the even turns waste it.
Weighted round robin is the version for different servers: each gets a weight based on how much it handles. If A is twice as powerful as B, A has weight 2 and B weight 1, and A gets 2 requests for every 1 of B's. It's like splitting tasks in a team: whoever works twice as fast gets twice as much. That way none is swamped before the others.
Least connections sends each new request to the server currently serving the fewest people. It's like picking the shortest checkout line at the supermarket, instead of going by turns. It helps when some requests take much longer than others: one server can be stuck with 3 long downloads while another has finished everything. Similar variants choose by lowest response time or by least traffic in Mbps.
Hash-based distribution uses a key from the request, like the user's IP or the URL, to always pick the same server. A hash is a calculation that turns any text into a number; that number says which server to go to. It's like assigning gym lockers by last name: A to F always get locker 1. That way the same user always lands on the same server, which can keep their data at hand.
A load balancer brings 4 advantages. Scalability: you add servers when traffic grows. Redundancy: there are spare pieces, so if 1 of 3 servers goes down, the other 2 keep going. Flexibility: you can take a server out to update it without shutting the app down. Efficiency: none is swamped while another sits idle. It's like having several checkouts at a supermarket instead of one: if one breaks, people keep paying.