What you pass in as a parameter has a local scope: it is a local variable. In your example above, the functions are, in essence (except nominally), identical.
What you may be getting confused with is the fact that you did:
While the first example may seem to make more sense, the second example works because you passed in the variable 'name' into the function's local variable (parameter). The 'name' variable that you passed it automatically becomes 'firstName', local to the function.
Hopefully that was clear enough.