Example 5 In $\triangle ABC$, $AB=BC>AC$, $AH$ and $AM$ are the altitude and median from vertex $A$ to side $BC$, respectively, and $\frac{S_{\triangle MHH}}{S_{\triangle ABC}}=\frac{3}{8}$. Determine the value of $\cos \angle BAC$. [s]
$(2009$, Beijing High School Mathematics Competition Preliminary (High $(-))$
Solve as shown in Figure 5, let $A B=A C$ $=a$, and $D$ be the midpoint of $A C$.
$$
\begin{array}{l}
\text { From } \frac{S_{\triangle M M H}}{S_{\triangle M B C}}=\frac{3}{8}, \\
B M=M C,
\end{array}
$$

we get
$$
\begin{array}{l}
H C=\frac{1}{2} a-\frac{3}{8} a=\frac{1}{8} a \\
\cos \angle B A C=\cos C \\
=\frac{H C}{A C}=\frac{H C}{2 D C}=\frac{H C}{2 a \cos C} .
\end{array}
$$

Therefore, $\cos ^{2} \angle B A C=\frac{1}{16}$.
Thus, $\cos \angle B A C=\frac{1}{4}$.