Example 7 For an integer $n(n \geqslant 2)$, try to determine the maximum real number $C_{n}$, such that for any positive real numbers $a_{1}, a_{2}, \cdots, a_{n}$, we have
$$
\frac{1}{n} \sum_{i=1}^{n} a_{i}^{2} \geqslant\left(\frac{1}{n} \sum_{i=1}^{n} a_{i}\right)^{2}+C_{n}\left(a_{1}-a_{n}\right)^{2}
$$
【Analysis】From the problem, we can define
$$
\begin{array}{l}
x_{i j}=a_{i}-a_{j}(1 \leqslant i<j \leqslant n) . \\
\text { Then } n \sum_{i=1}^{n} a_{i}^{2}-\left(\sum_{i=1}^{n} a_{i}\right)^{2} \\
=(n-1) \sum_{i=1}^{n} a_{i}^{2}-2 \sum_{i<j} a_{i} a_{j}=\sum_{i<j} x_{i j}^{2} \\
=x_{1 n}^{2}+\sum_{i=2}^{n-1}\left(x_{1 i}^{2}+x_{i n}^{2}\right)+\sum_{1<i<j<n} x_{i j}^{2} . \\
\text { And } \sum_{i=2}^{n-1}\left(x_{1 i}^{2}+x_{i n}^{2}\right) \geqslant \sum_{i=2}^{n-1} \frac{1}{2}\left(x_{1 i}+x_{i n}\right)^{2} \\
=\frac{n-2}{2} x_{1 n}^{2},
\end{array}
$$

Therefore, $n \sum_{i=1}^{n} a_{i}^{2}-\left(\sum_{i=1}^{n} a_{i}\right)^{2} \geqslant x_{1 n}^{2}+\frac{n-2}{2} x_{1 n}^{2}$
$$
=\frac{n}{2}\left(a_{1}-a_{n}\right)^{2}
$$
(ignoring $\sum_{1<i<j<n} x_{i}^{2}$ here).
Dividing both sides by $n^{2}$, we get
$$
\frac{1}{n} \sum_{i=1}^{n} a_{i}^{2}-\left(\frac{1}{n} \sum_{i=1}^{n} a_{i}\right)^{2} \geqslant \frac{1}{2 n}\left(a_{1}-a_{n}\right)^{2} .
$$

When $a_{2}=a_{3}=\cdots=a_{n-1}=\frac{a_{1}+a_{n}}{2}$, the above inequality holds with equality, and the maximum real number $C_{n}=\frac{1}{2 n}\left(x_{1 i}=x_{i n}(i=2,3\right.$, $\left.\cdots, n-1), x_{i j}=0(1<i<j<n)\right)$.