What exactly does the return type do in a function?
It returns it to whatever the function is being assigned to.
Take the function:
int plus(int a, int b) {
    return a + b;
}

That function takes two integers, adds them together, and &quot;returns&quot; them as an integer.
You can then do:
int c = plus(3, 4);

and c will be handed the value 7 by the function.
Equally you can do:
Serial.println(plus(3, 4));

And the Serial.println() function will be handed the value 7 for printing.
The type of the return defines the kind of data that can be returned.
Oh, and void doesn't mean &quot;returns nothing&quot;, but means &quot;doesn't return anything&quot; - which means you can't assign it to anything since there's nothing returned to assign.