Most health checks fall into one of three layers. A TCP check just opens a connection to a port and closes it; if the connection succeeds, the server passes. An HTTP check sends a GET request to a path like /health or /healthz and expects a 200 status code in the response. An application check goes further: the /health endpoint runs real logic, such as pinging the database and checking a cache connection, before it returns 200.
The load balancer tracks a small state machine per server using thresholds. A typical config is interval 10 seconds, timeout 5 seconds, healthy threshold 2, unhealthy threshold 3. That means a passing server needs 2 consecutive good checks before it is added back, and a failing one needs 3 consecutive failures before it is removed. The thresholds exist so a single slow response or a brief network blip does not flap a server in and out of rotation.
There is an important split between liveness and readiness. A liveness signal answers 'is the process alive', and a readiness signal answers 'can it take traffic right now'. During a rolling deploy, a new instance is alive long before it has loaded config, warmed its cache, and connected to dependencies. The readiness check is what holds traffic back until that startup work finishes, which is why a server can be live but deliberately reporting unhealthy.