Exercise $27$ from Atiyah and MacDonald states that if $A,B$ are two local rings, then $B$ is said to dominate $A$ iff $A$ is a subring of $B$ and the maximal ideal $\mathfrak{m}_A$ of $A$ is contained in the maximal ideal $\mathfrak{m}_B$ of $B$. Then, the book proceeds to say that this is equivalent to saying that $\mathfrak{m}_A=\mathfrak{m}_B\cap A$. I don't see why this is an equivalence and I would like if someone could help me see it.
I see that $\mathfrak{m}_A=A\cap \mathfrak{m}_B\Longrightarrow \mathfrak{m}_A\subset \mathfrak{m}_B$. My problem comes with the other direction. Assume that $\mathfrak{m}_A\subset \mathfrak{m}_B$. By intersecting with $A$ on both sides, we get that $\mathfrak{m}_A\subset \mathfrak{m}_B\cap A$. We want an equality here. Since $A$ is local, we have that either $\mathfrak{m}_B\cap A = \mathfrak{m}_A$ or $\mathfrak{m}_B\cap A=A$. I do not see why the second case is not possible.
I figured it out myself. $\mathfrak{m}_B\cap A$ cannot be the whole $A$ because this would mean $A\subset \mathfrak{m}_B$, and this cannot happen because all the elements of $\mathfrak{m}_B$ are nonunits and $A$ contains some units. Still, another approach is more than welcome.