In many books, valuations are introduced with the motivation of generalization of divisibility.
But, I could not touch it and digress, due to simple questions from elementary concepts in algebra.
If $R$ is a unique factorization domain, and $K$ is its quotient field, then with each prime $p$ in $R$, we get a valuation on $K$: write $a/b\in K$ (with $a,b\in R$) as $p^m(a'/b')$ where $a',b'$ are not divisible by $p$; then $p$-valuation of $a/b$ is defined to be $m$.
What is new achievement if we look at $m$ in terms of valuation instead of looking it in our ground-level stage - namely in UFD $R$? Why valuations are important/useful than division in UFD?
Let me give a more detailed answer, although Jonas Linssen is definitely correct. You are right that if $\nu_p$ is a valuation on $R$, the integer $\nu_p(a)=m$ is just the power of $p$ in the unique factorisation of $a$, $a=p^ma'$, where $a'$ is not divisible by $p$. But formalising this into a function is really useful, even just when working solely on $R$. The valuation $\nu_p$ has many neat properties: $\nu_p(a\cdot b) = \nu_p(a)+\nu_p(b)$, and $\nu_p(a+b)=\min(\nu_p(a),\nu_p(b))$ unless $\nu_p(a)=\nu_p(b)$, and more. Extending it to $K$ is very natural, the easiest way to do it is $\nu_p(\frac{a}{b})=\nu_p(a)-\nu_p(b)$, and it keeps the properties above. Perhaps the most important way to see how useful this is, is that it induces a metric on $K$, $|b|_p:=p^{-\nu_p(b)}$, so you get a metric space structure on $K$. This is in fact an ultrametric, simply by translating the properties above to the metric setting.
Now, you can suddenly do analysis on $K$, and the amazing thing about this is that this analysis can tell you algebraic and arithmetic properties of $R$. A great example of this is how the $p$-adic integers are treated in number theory: Let $R=\mathbb{Z}$, $p$ an actual prime. You can now complete $K=\mathbb{Q}$ with respect to the associated metric, giving you $\mathbb{Q}_p$, the $p$-adic numbers, and the number ring of this is $\mathbb{Z}_p$, the $p$-adic integers. I find it one of the most amazing facts of number theory that properties of $\mathbb{Z}_p$ can actually tell you things about $\mathbb{Z}$ (you can google the local-global principle, e.g. the Hasse-Minkowski theorem).
As a final remark, valuations can be defined in a more general setting, not needing unique factorisation. It turns out that you preserve all the important properties if you just have unique factorisation of ideals in $R$ (Dedekind Domains), and define $\nu_\mathfrak{p}(a)$ as the power of the prime ideal $\mathfrak{p}$ in the unique factorisation of the principal ideal $(a)$ generated by $a$.