Example 15 Let $x, y \in \mathbf{R}, M$ be the largest number among $x^{2}+x y+y^{2}, x^{2}+x(y-1)+(y-1)^{2},(x-1)^{2}+(x-1) y+$ $y^{2},(x-1)^{2}+(x-1)(y-1)+(y-1)^{2}$, find the minimum value of $M$.
Analyzing this type of problem falls under composite extremum (or double-layer extremum) problems, where the method of averages is the most commonly used approach. However, attention should be paid to the conditions for achieving the extremum.

It has been verified that for any real numbers \(x, y\):
\[
\begin{array}{c}
x^{2}+x y+y^{2} ; \quad x^{2}+x(y-1)+(y-1)^{2} ; \\
(x-1)^{2}+(x-1) y+y^{2} ; \quad(x-1)^{2}+(x-1)(y-1)+(y-1)^{2}
\end{array}
\]
it is impossible for all of them to be equal simultaneously. Therefore, when using the method of averages, some "tricks" need to be applied.

Since for any real numbers \(x, y\):
\[
\left[x^{2}+x y+y^{2}+(x-1)^{2}+(x-1)(y-1)+(y-1)^{2}\right]-\left[x^{2}+x(y-1)+(y-1)^{2}+\right.
\]
\[
\left.(x-1)^{2}+(x-1) y+y^{2}\right]=1, \text{ which is always greater than zero.}
\]
Thus,
\[
\begin{aligned}
2 M & \geqslant\left[x^{2}+x y+y^{2}+(x-1)^{2}+(x-1)(y-1)+(y-1)^{2}\right] \\
& =2 x^{2}+2 x y+2 y^{2}-3 x-3 y+3 \\
& =\frac{3}{2}(x+y)^{2}+\frac{1}{2}(x-y)^{2}-3(x+y)+3 \\
& =\frac{3}{2}(x+y-1)^{2}+\frac{1}{2}(x-y)^{2}+\frac{3}{2} \geqslant \frac{3}{2} .
\end{aligned}
\]
The equality holds if and only if \(x=y=\frac{1}{2}\), so the minimum value of \(M\) is \(\frac{3}{4}\).

At this point, \(x^{2}+x y+y^{2}=\frac{3}{4}, x^{2}+x(y-1)+(y-1)^{2}=\frac{1}{4}\),
\[
\begin{array}{l}
(x-1)^{2}+(x-1) y+y^{2}=\frac{1}{4} \\
(x-1)^{2}+(x-1)(y-1)+(y-1)^{2}=\frac{3}{4} .
\end{array}
\]
The original problem is solved.