Node.js uses the V8 engine because it was embeddable, fastest and most stable way to run JavaScript outside of a web browser when Node was created in 2009. While there are other engines (like SpiderMonkey for Firefox or JavaScriptCore for Safari), Ryan Dahl (the creator of Node.js) chose V8 for several strategic and technical reasons:
SpiderMonkey (Firefox): Tightly coupled to browser, hard to embed
JavaScriptCore (Safari): Less performant at the time
Rhino (Java-based): Too slow, JVM overhead
V8 (Chrome): Fast, standalone, embeddable, open-source
Unlike older engines that interpreted code line-by-line, V8 uses Just-In-Time (JIT) compilation at that time. It translates JavaScript directly into Native Machine Code that your computer's processor can execute immediately. This makes JavaScript nearly as fast as languages like C++ or Java for many tasks.
Google developed V8 to power the Chrome browser. Because Google wanted Chrome to be the fastest browser on the market, they invested massive amounts of engineering into making V8 highly optimized. By choosing V8, Node.js inherited years of world-class performance research for free.
V8 is written in C++ and was designed to be 'embeddable.' This means it doesn't require a browser to run. Ryan Dahl could take the V8 engine, strip away the browser parts (like the DOM and window), and wrap it in his own C++ code to give it 'superpowers'—like the ability to read files and listen to network ports. Other engines were not embeddable.
V8 includes a very sophisticated Garbage Collector. In a server environment, where a program might run for months without restarting, managing memory perfectly is critical. V8's ability to automatically find and 'clean up' objects that are no longer being used prevents the server from crashing due to memory leaks.