Why do we "swap out" the variable of interest in an integral with some other variable?

I have the following question: Why do we "swap out" the variable of interest in an integral with some other variable?

For example, in the following integral:

The integral is set up in terms of a variable "Y". However, when the integral is actually written - "Y" is replaced with a new variable "Z" (e.g. dz).

My Question: Does anyone know why this happens? Why is it necessary to do this? Or is this just "mathematical tradition"?

Thanks!

References:

• $Y$ is a "random variable" - that's a technical term. $z$ is just the variable of integration. These are different concepts. Nov 17 '21 at 7:37
• @ ancient mathematician : thank you for your reply! Just a question: is my understanding correct? in the above integral - are "z" and "Y" interchangeable? Thank you! Nov 17 '21 at 7:38
• I've already said they are different concepts so of course they are not interchangeable. You've really got to go back to the definition of "random variable" and of "probability distribution". Nov 17 '21 at 7:40
• Cross-posted: stats.stackexchange.com/questions/552647/… Nov 17 '21 at 21:00