I'm only a few weeks into my first programming course, and I have a terrible C++ teacher. She attempted to explain the relationship between formal and actual parameters by veering off into CSS order of precedence (clockwise selection of the sides of a box).

Due to her nonsense "explanations", I have yet to understand how returning a variable is mechanically different from... anything else, really. In fact, I think I just have no idea how functions actually... function.

I suppose what I'm asking is, how does return actually work?

Here's an example of what I'm talking about.

Code:
int function (int a) {
a = 5;
return a();
}
vs

Code:
void function (int& a) {
a = 5;
}

I understand that using return "returns a value to it's caller", but what is the practical application of that? What is the advantage of using return instead of any other method of assigning a variable? Or... whatever it is that return does?