An event loop serves many connections from one thread: it asks the system, with poll(fds, n, timeout), which of a set of descriptors are ready (a recv or an accept on them would not wait), handles each ready one briefly, and asks again. A connection’s state between two events, such as a request received in part, is kept in a structure of the program.
poll. Nothing blocks, so one thread keeps every connection moving.fork, a thread, or nothing extra; with one short request per connection, that cost is most of the work.