Example 2 Let $x, y, z$ be real numbers, not all zero. Find the maximum value of $\frac{x y+2 y z}{x^{2}+y^{2}+z^{2}}$.


Explanation: Directly applying the AM-GM inequality to the numerator or denominator clearly does not achieve the goal. Therefore, we introduce parameters $a$ and $b$ as undetermined coefficients for substitution, and then apply the AM-GM inequality for processing.
$$
\begin{array}{l}
x y+2 y z \\
=2\left(\sqrt{\frac{a}{2}} x\right)\left(\sqrt{\frac{1}{2 a}} y\right)+2(\sqrt{b} y)\left(\sqrt{\frac{1}{b}} z\right) \\
\leqslant\left(\frac{a}{2} x^{2}+\frac{1}{2 a} y^{2}\right)+\left(b y^{2}+\frac{1}{b} z^{2}\right) \\
=\frac{a}{2} x^{2}+\left(\frac{1}{2 a}+b\right) y^{2}+\frac{1}{b} z^{2} . \\
\text { Let } \frac{a}{2}=\frac{1}{2 a}+b=\frac{1}{b} .
\end{array}
$$

Solving, we get $a=\sqrt{5}, b=\frac{2 \sqrt{5}}{5}$.
Thus, $x y+2 y z \leqslant \frac{\sqrt{5}}{2}\left(x^{2}+y^{2}+z^{2}\right)$.
The equality holds if and only if $10 x=2 \sqrt{5} y=5 z$.
Therefore, the maximum value of $\frac{x y+2 y z}{x^{2}+y^{2}+z^{2}}$ is $\frac{\sqrt{5}}{2}$.