The name comes from the OSI model. Layer 4 is the transport layer, where TCP and UDP live. A Layer 4 load balancer makes its routing decision using the four or five values it can see in the packet headers: source IP, source port, destination IP, destination port, and the protocol. That set is often called the connection 5-tuple.
Because it works at this level, it has no idea whether the traffic is HTTP, gRPC, a MySQL query, an MQTT message, or a video stream. It treats every connection as an opaque flow of bytes. This is the key difference from Layer 7 load balancing, which terminates the connection, reads the full HTTP request, and can route based on the URL path, host header, or cookie.
A common way to picture it: a Layer 4 balancer is a smart switchboard that connects caller to agent based on the number dialed, without ever listening to the conversation.