Example 6 Let the base of the pyramid $M-ABCD$ be a square, and $MA=MD$, $MA \perp AB$. If the area of $\triangle AMD$ is 1, try to find the radius of the largest sphere that can fit inside such a pyramid.

Solution: Projecting in the direction of $BC$ onto the plane yields $\mathrm{Rt} \triangle EFG$.
Projecting in the direction of $AB$ onto the plane yields isosceles $\triangle HIJ$.
From $\triangle A I J \cong \triangle A D M$ and the perimeter of $\triangle E F G >$ the perimeter of $\triangle H I J$, we get $r < r'$. Therefore, the ball cannot simultaneously be tangent to $A M B$, $C M D$, and $A B C D$. Thus, the radius of the ball can only be the inradius $r$ of the right triangle $\triangle E F G$. Let the side length of the square be $a$, then from
$$
\begin{array}{l}
S_{\triangle E F G}=S_{\triangle A D M}=1 \text { we get } \\
E G=\frac{2}{a}, F G=\sqrt{a^{2}+\left(\frac{2}{a}\right)^{2}} .
\end{array}
$$

Therefore, $r=\frac{2}{a+\frac{2}{a}+\sqrt{a^{2}+\left(\frac{2}{a}\right)^{2}}} \leqslant \frac{2}{2 \sqrt{2}+2}=\sqrt{2}-1$, when $a=\frac{2}{a}$, i.e., $a=\sqrt{2}$, $r_{\text {max }}=\sqrt{2}-1$.