Let $x$ and $y$ be two vectors, $x\cdot y$ their scalar product, $\beta$ the angle between the vectors, and $|x|$ and $|y|$ their absolute values. Then we have
$$|x| |y| \cos \beta =x \cdot y \quad (1)$$
I wonder for what precise conditions when (1) implies
$$\cos \beta =\frac{x\cdot y}{|x| |y|} \quad (2)$$
Thanks
First one has to ask: What is an angle as geometric object?
Then, this identity is the definition of the angle measure $β$ for given nonzero vectors $x$ and $y$.
The deep insight behind it is the Cauchy-Schwarz inequality, or the Binet-Cauchy equation if you want a term for the difference in the CS inequality. This tells you that $|x⋅y|\le |x||y|$ so that the fraction $\frac{x⋅y}{|x||y|}$ actually takes values inside the intervall $[-1,1]$ so that it can be identified with values of the cosine function.