Example 4 If $a, b, c$ are non-negative real numbers and $a+b+c=1$, try to find the maximum value of $S=ab+bc+ca-3abc$.

保留源文本的换行和格式，直接输出翻译结果。
Let's assume $a \geqslant b \geqslant c$, then $c \leqslant \frac{1}{3}$. Fix $c$,
$$S=a b+b c+c a-3 a b c=a b(1-3 c)+c(a+b)$$

Since the value of $a+b$ is fixed, $1-3 c \geqslant 0$, and $a b$ reaches its maximum value when $a=b$, hence $S$ reaches its maximum value when $a=b$.

Adjust $a, b, c$ to $a=b \geqslant c$, then $b \geqslant \frac{1}{3}$. Fix $b$,
$$S=a b+b c+c a-3 a b c=a c(1-3 b)+b(a+c)$$

Since $1-3 b \leqslant 0$ and the value of $a+c$ is fixed, $S$ reaches its maximum value when the difference between $a$ and $c$ is the largest. And $a-c \leqslant 1-b$, at this point $c=0$.

Therefore, we only need to find the maximum value of $a b$ when $c=0$ and $a+b=1$, which is clearly $\frac{1}{4}$.
Thus, when two of $a, b, c$ are $\frac{1}{2}$ and the other is 0, $S$ reaches its maximum value of $\frac{1}{4}$.