Let $\phi : G \to H/N$ be a homomorphism where $G$ and $H$ are groups and let $M \unlhd G$ and $N \unlhd H$.
Now when does $\phi$ induces a homomorphism $\phi^*$ from $G/M \to H/N\ ?$
- When $M \subseteq \text{ker}(\phi)$
- When $\text{ker}(\phi) \subseteq M$.
- or in both cases?
In the both cases, induced homomorphism looks like $$\phi^*(g+M)=\phi(g)+N$$
So is it a homomorphism in both cases? If yes, Why does it has to to satisfy a containment relation with $ker(\phi)$. What if $M$ is just some random subgroup of $G$?
Only when $M\subseteq \ker(\phi)$ (and of course, we also need $M$ to be normal in $G$, which is necessary for $G/M$ to be a group in the first place.)
First, forget about $H$ and $N$, which play no role separately in your question. We may as well just set $Q=H/N$. Thus, you have a homomorphism $\phi:G\to Q$, and want to know when there is an induced homomorphism $\phi^*:G/M\to Q$.
In order for the (proposed) formula $$\phi^*(gM)=\phi(g)$$ to make a well-defined function $\phi^*:G/M\to Q$, you need to have $$g_1M=g_2M\implies \phi(g_1)=\phi(g_2)$$ which by the first isomorphism theorem is equivalent to $$g_1M=g_2M\implies g_1\ker(\phi)=g_2\ker(\phi)$$ which is equivalent to $$g\in M\implies g\in\ker(\phi)$$ which is equivalent to $M\subseteq\ker(\phi)$.