Example 2: There are $n$ marbles. Arbitrarily divide them into two piles, find the product of the number of marbles in the two piles, then arbitrarily divide one of the piles into two piles, find the product of the number of marbles in these two piles, and so on. Each time, arbitrarily divide one of the piles into two piles, find the product of the number of marbles in these two piles, until no more division is possible. Let the sum of all products be $S$, find the possible values of $S$.
On the one hand, the number of all pairs of marbles composed of two marbles is clearly $C_{n}^{2}$. On the other hand, each time a pile is divided, some of the original pairs of marbles are separated into two piles, and the number of pairs separated at each step is exactly equal to the product of the number of marbles in the two resulting piles, and in the end, all $C_{n}^{2}$ pairs of marbles are separated. Therefore, the sum $S$ of all the products is exactly the number of all pairs of marbles at the beginning, $C_{n}^{2}$, that is, $S$ can only take one value, which is
$$
S=C_{n}^{2}=\frac{1}{2} n(n-1) .
$$