What does correlation formula really tell you? The formula for correlation coefficient is as follows:
$$\begin{align}\mathrm{corr} \left(\vec x, \vec y\right) = \frac{1}{n} \sum_{i=1}^n \frac{\left(x_i-\bar x\right)}{\sigma_x} \cdot \frac{\left(y_i - \bar y\right)}{\sigma_y} \end{align}$$
The idea behind correlation is the more similarly respective values in $\vec x$ and $\vec y$ deviates from their means, the closer $\mathbf{corr \left(\vec x, \vec y\right)}$ is to $\mathbf 1$. But how to read it off from this formula? It's not clear from the formula what it really calculates.

P.S. I don't know whether it's common on this site, but I've written the question to leave an answer. If it's not, let me know in comments.
 A: Let's rewrite this formula as follows:
$$\begin{align}
\mathrm{corr} \left(\vec x, \vec y\right) = \frac{\sum \left(x_i - \bar x\right)\left(y_i - \bar y\right)}{\sqrt{\sum\left(x_i - \bar x\right)^2}\sqrt{\sum\left(y_i - \bar y\right)^2}} =
\\
= \frac{\left(\vec x - \bar x\right)}{\|\vec x - \bar x\|} \cdot \frac{{\left(\vec y - \bar y\right)}}{{ \|\vec y - \bar y\|}} =
\\
= \cos \theta
\end{align}$$
Hence $\mathrm{corr} \left(\vec x, \vec y\right)$ is just $\cos \theta$, where $\theta$ is the angle between vectors $\left(\vec x - \bar x\right)$ and $\left(\vec y - \bar y\right)$.
When we ask:

Why similar deviations of respective values in $\vec x$ and $\vec y$ from their means (expressed in standard units) make correlation coefficient closer to $1$?

by that we actually ask:

Why being vector $\frac{\left(\vec x - \bar x\right)}{\|\vec x - \bar x\|}$ closer to vector $\frac{{\left(\vec y - \bar y\right)}}{{ \|\vec y - \bar y\|}}$ makes the $\cos \theta$ closer to $1$?

since $\frac{\left(\vec x - \bar x\right)}{\|\vec x - \bar x\|}$ and $\frac{{\left(\vec y - \bar y\right)}}{{ \|\vec y - \bar y\|}}$ are those deviations (divided by $n$).

The takeaway is that when we calculate $\mathrm{corr} \left(\vec x, \vec y\right)$ we actually calculate the cosine of the angle between unit vectors $\frac{\left(\vec x - \bar x\right)}{\|\vec x - \bar x\|}$ and $\frac{{\left(\vec y - \bar y\right)}}{{ \|\vec y - \bar y\|}}$. Hence this angle tend to $0$ as respective deviations of vectors $\vec x$ and $\vec y$ from their means (i.e. coordinates of the unit vectors) tend to be the same.
