Load balancers operate at one of two levels of the network stack. A layer 4 load balancer works at the transport level, looking only at IP addresses and TCP or UDP ports. It does not read the actual request, so it is extremely fast and protocol-agnostic, but it cannot make decisions based on content.
A layer 7 load balancer works at the application level and can read the HTTP request itself: the path, the headers, the cookies. That lets it route smartly, sending /api requests to one pool and /images to another, terminating TLS, or doing path-based and host-based routing. It does more work per request, so it is a little slower, but the routing intelligence is usually worth it for web traffic. Most modern application load balancers, like AWS ALB, are layer 7.