Node.js works by using an event-driven, non-blocking I/O model, which makes it lightweight and efficient. When a request comes in, Node.js puts the request in a queue and moves on to the next request. When the request is ready to be processed, Node.js will pick it up from the queue and execute the request. This allows it to handle a large number of requests concurrently with a small number of threads.
One of the key benefits of using Node.js is that it allows you to build scalable network applications, as it can handle a large number of concurrent connections with high throughput. It is also well-suited for real-time applications, such as chat or gaming applications, due to its low-latency and high-throughput capabilities.