Let's read two small functions and trace exactly what happens when each is called.
function greet(name = "friend") { return `Hello, ${name}!`; } defines a reusable piece of logic. Defining it alone does not run it nothing happens until it's actually called somewhere.
${greet("Ali")} calls the function with "Ali" as the argument. Inside the function, the parameter name becomes "Ali" for this specific call, and it returns "Hello, Ali!" which is what gets inserted into the template literal.
${greet()} calls the exact same function, but with no argument at all. Because name has a default value of "friend", it falls back to that instead of becoming undefined this call returns "Hello, friend!".
function add(a, b) { return a + b; } is simpler: called as add(3, 4), a becomes 3 and b becomes 4, and it returns their sum, 7. Notice the same add function would work identically for any two numbers that reusability, calling the same logic with different inputs, is the entire point of writing a function in the first place.
