Ah, Node.
Let me give you a little bit information about how Node works. So, Node operates on a single thread. You can imagine as a rail line, but in the case of Node.js, only one train can run on it at a time. Therefore, single-threaded.
Now, to offer some great features, NodeJS needed a workaround for this; they came up with the idea of observers, and an event loop. In the observer design pattern, a father process, keeps on observing (looking for changes) an object; this goes on infinitely.
So, whenever an event is complete, a registered callback is fired. Let's take an example:
const obj = {
doStuff() {
...
emitEvent( 'complete' );
...
};
obj.on( 'complete', () => {
console.log( 'Done!' );
} );
As you can see, using this method, we can very easily achieve pseudo-multithreading; in the sense that you can execute multiple blocking (anything which doesn't allow the function stack to progress further; say XMLHttpRequest) functions.
This entire thing: Attach callback, on event complete, fire callback, repeat is called the event-driven nature of Node.js.
Again, if you have any other doubts, ask me! I hope this helps! :)