Question about a node.js code snippet

Hello, I am currently trying to learn how to use node.js to create a basic backend REST API for a front-end app that I made, so I decided to take a course on coursera about it.

I am just trying to understand this code snippet the professor of the course used in an example to explain how closures help us with error handling in node. Below I will put code used to handle an error in an index.js file

var rect = require("./rectangle");
function solveRect(l,b) {
    console.log("Solving for rectangle with l = "
                + l + " and b = " + b);
    rect(l,b, (err,rectangle) => {
        if (err) {
	        console.log("ERROR: ", err.message);
	    }
        else {
            console.log("The area of the rectangle of dimensions l = "
                + l + " and b = " + b + " is " + rectangle.area());
            console.log("The perimeter of the rectangle of dimensions l = "
                + l + " and b = " + b + " is " + rectangle.perimeter());
        }
    });
    console.log("This statement after the call to rect()");
};

Now this is the code used in the rectangle.js file that was referenced in the index.js file

module.exports = (x,y,callback) => {
    if (x <= 0 || y <= 0)
        setTimeout(() => 
            callback(new Error("Rectangle dimensions should be greater than zero: l = "
                + x + ", and b = " + y), 
            null),
            2000);
    else
        setTimeout(() => 
            callback(null, {
                perimeter: () => (2*(x+y)),
                area:() => (x*y)
            }), 
            2000);
}

So my question is how is that the computer knows that “err” used in the callback function in our index.js file is referring to the error we generated in our setTimeout function call?