The following is taken from Mostly Commutative Algebra by Chambert-Loir
$\color{Green}{\bf Background\!:}$
$\textbf{Proposition:}$ A diagram of $A$-modules $$ 0 \xrightarrow{} N \xrightarrow{i} M \xrightarrow{p} P \xrightarrow{} 0 $$ is an exact sequence if and only if
(i) The morphism $i$ is injective;
(ii) $\operatorname{Ker}(p) = \operatorname{Im}(i)$;
(iii) The morphism $p$ is surjective.
Then, $i$ induces an isomorphism from $N$ to the submodule $i(N)$ of $M,$ and $p$ induces an isomorphism of $M/i(N)$ with $P$.
Proof. It suffices to write down all the conditions of an exact sequence. The image of the map $0\to N$ is $0$; it has to be the kernel of $i$, which means that $I$ is injective. The next condition is $\operatorname{Im}(i) =\operatorname{Ker}(p)$. Finally, the image of $p$ is equal to the kernel of the morphism $P\to 0$, which means that $p$ is surjective. The rest of the proof follows from the factorization theorem: if $p$ is surjective, it induces an isomorphism from $M/\operatorname{Ker}(p)$ to $P$; if $i$ is injective, it induces an isomorphism from $N$ to $i(N) = \operatorname{Ker}(p)$.
$\color{Red}{\bf Questions\!:}$
For the Proposition above, I have a question about condition $(ii)$. From the sequence of $A$-modules morphisms, we know that $i$ is injective, and $p$ is surjective. But, for the condition $\operatorname{Ker}(p) = \operatorname{Im}(i)$, does it implicitly assume that $P$ is isomorphic to $M/N$? Basically, if I am given a sequence of morphisms: $$ 0 \xrightarrow{} N \xrightarrow{i} M \xrightarrow{p} P \xrightarrow{} 0, $$ where $N,M,P$ could be either groups, vector spaces, modules, with $i$ being an injective map, $p$ being a surjective map; then what additional assumption does one need to make on $N,M,P$ in order to have $\operatorname{Ker}(p) = \operatorname{Im}(i)$ to be true so that $$ 0 \xrightarrow{} N \xrightarrow{i} M \xrightarrow{p} P \xrightarrow{} 0, $$ is an exact sequence?
Thank you in advance.
If I give you two maps $i\colon N \to M$ and $p\colon M \to P$ with $i$ injective and $p$ surjective, a priori, you know almost nothing about the relationship between $I=\mathrm{im}(i)$ and $K=\mathrm{ker}(p)$.
For example, if $A = \mathsf k$ is a field, then if $M=\mathsf k^n$ and $N=\mathsf k^r$, $P=\mathsf k^s$, then giving an injection $i\colon \mathsf k^r \to \mathsf k^n$ and a surjection $p\colon \mathsf k^n\to \mathsf k^s$ shows only that $\mathrm{max}\{r,s\}\leq n$. On the other hand, if $(i,p)$ formed a short exact sequence, then $r+s=n$.
Let us write $I = \mathrm{im}(i)$ and $K= \mathrm{ker}(p)$, so that $(i,p)$ induce a short exact sequence if and only if $I=K$. In terms of short exact sequences, any injective homomorphism of $A$-modules $i \colon N \to M$ induces a short exact sequence: $$ \require{AMScd} \begin{CD} 0 @>>> N @>{i}>> M @>{q_I}>> M/I @>>> 0 \end{CD} $$ where $q_I\colon M \to M/I$ is the quotient map.
Similarly, any surjection $p\colon M\to P$ induces a short exact sequence $$ \require{AMScd} \begin{CD} 0 @>>>K @>{i_K}>> M @>{p}>> P @>>> 0 \end{CD} $$ where $i_K$ is the inclusion map.
One way of capturing what is required for $(i,p)$ to form a short exact sequence is then that $(i,p)$ form a short exact sequence precisely when they induce an isomorphism $(\bar{i},\mathrm{id}_M,\bar{p})$ between these two short exact sequences:
$$ \require{AMScd} \begin{CD} 0 @>>>N @>{i}>> M @>{q_I}>> M/I @>>> 0\\ @. @V{\bar{i}}VV @VV{\mathrm{id}_M}V @VV{\bar{p}}V @.\\ 0 @>>>K @>{i_K}>> M @>{p}>> P @>>> 0 \end{CD} $$
that is, $i$ factors through $i_K$ so $i = i_K\circ \bar{i}$ and $p$ factors through $q$ so that $p = \bar{p}\circ q_I$, and the induced maps $\bar{i}$ and $\bar{p}$ are isomorphisms making the diagram commute.