Load balancers need to know which servers are healthy. They do this through health checks.
Active health checks: The load balancer periodically pings each server. "/health" endpoint returns if healthy.
Passive health checks: The load balancer monitors real traffic. Too many errors? Mark the server unhealthy.
When a server fails health checks, the load balancer stops sending traffic to it. When it recovers, traffic resumes.
Configure health check intervals carefully. Too frequent wastes resources. Too infrequent means slow failover.