Example 2 Find all pairs of positive integers $(x, y)$ that satisfy $x^{y}=$ $y^{x-y}$.

 untranslated portion:
将上面的文本翻译成英文，请保留源文本的换行和格式，直接输出翻译结果。 

This part is a note and not part of the translation request, so it is not translated. However, since the request was to translate the provided text and maintain the format, the translation is provided as requested above.
Solution: Clearly, $(1,1)$ is a solution, and when the equation has a solution, it must be that $x \geqslant y$. If $x=y$, then $x=y=1$.

If $x>y \geqslant 2$, then from $x^{y}=y^{x-y}$ we get $12 y$, and $y \mid x$.
Let $x=k y$, then $k \geqslant 3, k^{y}=y^{(k-2) y}$,
so $k=y^{k-2}$.
Since $y \geqslant 2$, we have $y^{k-2} \geqslant 2^{k-2}$, and for $k \geqslant 5$, $y^{k-2} \geqslant 2^{k-2}>k$ (which can be proven by induction), so $k=3,4$.

When $k=3$, $y=3, x=9$; when $k=4$, $y=2$, $x=8$;

Therefore, all the positive integer pairs $(x, y)=(1,1),(9, 3),(8,2)$.