Example 8 Let $n(n \geqslant 2)$ be a fixed integer. Determine the smallest constant $c$ such that
$$
\sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j}\left(x_{i}^{2}+x_{j}^{2}\right) \leqslant c\left(\sum_{i=1}^{n} x_{i}\right)^{4}
$$

holds for all non-negative real numbers $x_{1}, x_{2}, \cdots, x_{n}$, and determine the necessary and sufficient conditions for equality.
【Analysis】Obviously, when $x_{1}=x_{2}=\cdots=x_{n}=0$, inequality (1) always holds.

If $x_{i}(i=1,2, \cdots, n)$ are not all 0, by homogeneity, we can assume $\sum_{i=1}^{n} x_{i}=1$.
When $n=2$, $x_{1}+x_{2}=1$,
the left side of equation (1)
$$
\begin{array}{l}
=x_{1} x_{2}\left(x_{1}^{2}+x_{2}^{2}\right)=x_{1} x_{2}\left(1-2 x_{1} x_{2}\right) \\
=\frac{1}{2} \times 2 x_{1} x_{2}\left(1-2 x_{1} x_{2}\right) \leqslant \frac{1}{8},
\end{array}
$$

with equality holding if and only if $x_{1}=x_{2}=\frac{1}{2}$.
When $n \geqslant 3$, assume $x_{1}+x_{2}<\frac{3}{4}$, and let $x_{3}$, $x_{4}, \cdots, x_{n}$ be fixed.
Let $x_{1}+x_{2}=a$.
Then the left side of equation (1)
$$
\begin{array}{l}
= \sum_{i=1}^{n}\left(x_{i}^{3} \sum_{j \neq i} x_{j}+x_{i} \sum_{j \neq i} x_{j}^{3}\right) . \\
\text { Let } A=x_{1}^{3}\left(1-x_{1}\right)+x_{2}^{3}\left(1-x_{2}\right) \\
=\left(x_{1}+x_{2}\right)\left[\left(x_{1}+x_{2}\right)^{2}-3 x_{1} x_{2}\right]- \\
{\left[\left(x_{1}+x_{2}\right)^{2}-2 x_{1} x_{2}\right]^{2}-2 x_{1}^{2} x_{2}^{2} . }
\end{array}
$$

Let $x_{1} x_{2}=t$. Then
$$
\begin{aligned}
A & =a\left(a^{2}-3 t\right)-\left(a^{2}-2 t\right)^{2}-2 t^{2} \\
& =-2 t^{2}+\left(4 a^{2}-3 a\right) t-a^{4} .
\end{aligned}
$$

Since $a<\frac{3}{4}$, the axis of symmetry is less than 0, and the parabola opens downwards.

Thus, when $x_{1} x_{2}=0$, it has the maximum value. Without loss of generality, assume $x_{1}=0$, at this point, the problem is reduced to an $(n-1)$-variable problem, and so on, it is reduced to a two-variable problem. Therefore, it is known that the equality in inequality (1) holds if and only if two of the variables are equal and the rest are 0.