Ring homomorphism composition of surjective and injective map.

So say I have two rings, $$R_1$$ and $$R_2$$, and I have a homomorphism between them, $$\phi$$.

There are sources, such as my lecturer, who said in passing that the homomorphism $$\phi$$ can be factorized as a composition of a surjective map and an injective map$$R_1 \to \phi(R_1) \hookrightarrow R_2.$$The first arrow is $$\phi$$ and onto, of course. And the image $$\phi(R_1)$$ is a subring of $$R_2$$, while it is a quotient ring of $$R_1$$.

What is the significance of this, and how do I see this? It seems mysterious. I'll rattle off a few of my thoughts.

• The first arrow is onto, so everything in the image, i.e. $$R_1$$ gets hit. No one gets left out. And the cardinality of $$R_1$$, "morally", is at least as big as that of $$\phi(R_1)$$ if we want to preserve the structure. Indeed, $$\phi(R_1)$$ is a quotient ring of $$R_1$$, which should indicate it's like a miniature version of $$R_1$$.
• The second arrow is into, so $$1$$-to-$$1$$, no funny business like $$y = x^2$$, etc. It's sort of the opposite of the first map. "Morally" the cardinality of $$R_2$$ is at least as big as that of $$\phi(R_1)$$. And yeah, $$\phi(R_1)$$ is just the image living inside this ambient space of $$R_2$$. Hence subring.

I guess I am curious, what is the usefulness of this factorization for algebraic geometry (which a lot of people on this website talk about), i.e. what important problems does it solve there?

The other answers do a good job of explaining how the factorization works on the ring side: for a ring map $$\phi:R\to S$$, decompose the map as $$R\to R/\ker\phi \to S$$ via the first isomorphism theorem, and check that the first map is surjective and the second map is injective.
If you want to apply this result to algebraic geometry, you need to know that surjective maps of rings correspond via $$\operatorname{Spec}$$ to closed immersions of affine varieties and injective maps correspond in the same way to dominant maps of affine varieties. As $$\operatorname{Spec}$$ is a contravariant functor, this means the factorization of $$R\to S$$ into $$R\twoheadrightarrow R/\ker\phi \hookrightarrow S$$ corresponds to $$\operatorname{Spec} S \to \operatorname{Spec} (R/\ker\phi) \to \operatorname{Spec} R$$ where the first map is dominant and the second is a closed immersion.
Well, in view of the homomorphism theorem, for each homomorphism $$\phi:R_1\rightarrow R_2$$, there is an injective homomorphism $$\psi:R_1/\ker\phi \rightarrow R_2$$ given by $$\psi(r+\ker \phi) = \phi(r)$$. When the image is restricted to $$\phi(R_2)$$, the mapping $$\psi:R_1/\ker\phi\rightarrow \phi(R_1)$$ is an isomorphism. This gives you homomorphisms $$R_1\rightarrow R_1/\ker\phi:r\mapsto r+\ker\phi$$, $$R_1/\ker\phi\rightarrow \phi(R_1); r+\ker\phi\mapsto \phi(r)$$ and an embedding $$\phi(R_1)\rightarrow R_2$$ of the subring $$\phi(R_1)$$ into $$R_2$$, as claimed.
As for intuition, obseve by the First Isomorphism Theorem that $$R_1\twoheadrightarrow R_1/ \text{ker}(f)\overset{\cong}{\to} \text{im}(f)\hookrightarrow R_2$$ Leading to (two equally valid) factorizations: $$R_1\overset{f}{\longrightarrow} R_2=\left(\text{im}(f)\hookrightarrow R_2\right)\circ \left(R_1\twoheadrightarrow R_1/ \text{ker}(f)\overset{\cong}{\to} \text{im}(f)\right)$$ And $$\left(R_1/ \text{ker}(f)\overset{\cong}{\to} \text{im}(f)\hookrightarrow R_2\right)\circ \left(R_1\twoheadrightarrow R_1/\text{ker}(f)\right)=R_1\overset{f}{\longrightarrow} R_2$$