Example 4. 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, find the radius of the largest sphere that can fit inside this pyramid.
(1990, National High School Mathematics Competition)
Given $A B \perp A D$, $A B \perp A M$, we know that $A B \perp$ plane $M A D$. Therefore, plane $A B C \perp$ plane $M A D$. Construct a section $M E F$ perpendicular to $A D$, then $\triangle M E F$ is a right triangle, with area $\frac{1}{2} E F \cdot E M=\frac{1}{2} A D$ - $E M=1$.

It is easy to see that when $E F=E M$, $\triangle M E F$ has the largest inscribed circle, at this time $E F=E M=\sqrt{2}, M F=2$, the radius of the inscribed circle is $r=\frac{1}{2}(E F+E M-M F)=\sqrt{2}-1$.
Let the distance from the center $O$ to the side faces $M A B, M D C$ be $d$, then
$$
\begin{aligned}
V_{M-A B C D}= & \frac{1}{3} r\left(S_{\triangle M A D}+S_{A B C D}+S_{\triangle M B C}\right) \\
& +\frac{2}{3} d S_{\triangle M A B} \\
= & \frac{1}{3} S_{A B C D} \cdot E M,
\end{aligned}
$$

which is $(\sqrt{2}-1)(1+2+\sqrt{2})+\sqrt{5} d=2 \sqrt{2}$,
solving for $d$ gives $d=\frac{1}{\sqrt{5}}>\sqrt{2}-1=r$.
Therefore, the sphere with center $O$ and radius $\sqrt{2}-1$ is the largest sphere that can fit inside this pyramid.