I am uncertain about the motivation for the contraction and extension of ideals. I understand the definition, and understand that the two operations respect certain properties, e.g. if $f: A \rightarrow B$ is a ring homomorphism, then $\mathfrak{b}$ is a prime ideal of $B$ $\implies$ $\mathfrak{b}^c$ is a prime ideal of $A$, or that contracting and extending an ideal in $A$ is a projection.
Naturally I would expect such operations to also help gain more insight about the rings $A$ and $B$, or the ideals being contracted/extended. However, I haven't seen yet any examples of contractions/extensions giving any particular interesting insight.
The following quote from the Wikipedia page on ideals suggests that there is some non-trivial insight to be gained from studying contractions/extensions, at least for an algebraic number-theoretic setting:
Remark: Let $K$ be a field extension of $L$, and let $B$ and $A$ be the rings of integers of $K$ and $L$, respectively. Then $B$ is an integral extension of $A$, and we let $f$ be the inclusion map from $A$ to $B$. The behaviour of a prime ideal $\mathfrak{a}=\mathfrak{p}$ of $A$ under extension is one of the central problems of algebraic number theory.
I have not yet studied algebraic number theory indepth, so I am missing the bigger picture of how studying extensions of prime ideals of $A$ is useful in this scenario. What I am hoping for is that the above quote is a specific instance of a more general ring-theoretic scenario, and if the corresponding idea behind it could be motivated.
One way of getting insights about commutative algebra results for me is looking for their implications in Algebraic Geometry.
These notes from Andreas Gathmann (https://www.mathematik.uni-kl.de/~gathmann/en/commalg.php) have a whole chapter (9) dedicated to ring extensions, and the results Lying Over and Going Up are translated to problems about when a projection of a variety is well behaved or not. In these cases, you can really see how the contraction of a prime ideal is related with the problem of surjectivity of this projection, for example.