In the category of groups, the free product with amalgamation is the realization of the pushout when both functions are embeddings. More generally, say that $f\colon H\to G$ and $g\colon H\to K$ is a pushout diagram. If $\mathrm{ker}(f)=\mathrm{ker}(g)$, then the pushout is given (up to unique isomorphism) by $G*_{f(H)\sim g(H)}K$.
However, there are pushouts that cannot be realized as the free amalgamated product. For example, if $H$ is nontrivial, $f$ is the trivial map, and $g$ is an embedding, then you can’t get the amalgamated free product, because you cannot amalgamate the trivial image of $H$ in $G$ with the nontrivial image of $H$ in $K$.