Node.js functions as a runtime environment for executing JavaScript code server-side. It uses Google's V8 JavaScript engine to interpret JavaScript code and build real-time network applications.