$$ r = \frac{ \sum z_x z_y }{n-1}\,, $$
where $$z_x = \frac{x_i - \bar{x}}{\sigma_x}$$ and
$$z_y = \frac{y_i - \bar{y}}{\sigma_y}$$
I came across the above formula for correlation when reading a statistics textbook. I have an intuitive understanding of what correlation is and why it is a defined statistic/parameter. What I don't understand is why the above formula for calculating the correlation coefficient is defined this way.
Isn't the correlation coefficient meant to be a measure for correlation between the values $ -1 \leq r \leq 1 $ where r is the correlation coefficient? How does the above formula scale the value of the correlation coefficient so that for every possible distribution of two quantitative variables (x and y) it is always between $ -1 \leq r \leq 1 $ Couldn't you have a z-score of 2 and 3, which when multiplied together will give 6, causing the numerator to be greater than the denominator?
Also, is this the only way to define the formula for the correlation coefficient, I have seen other formulas for the correlation coefficient in different textbooks and got confused as to why there is more than one definition for the formula for the correlation coefficient.