Similarity of extension of prime ideal and extension of valuation $\textbf{[Extension of prime ideal]}$
Let $L/K$ be a separable extension is given by a primitive element $\theta \in B$ so that $L=K(\theta)$.
( $A$ is a dedekind domain , $K=Frac(A)$, $B$ is integral closure in $L$ of $A$ ) Let $f(x) \in A[x]$ be a minimal polynomial of $\theta$ ,$\frak{p}$ be a prime ideal of $A$ which is relatively prime to the conductor of $A[\theta]$, and let $$ \bar{f}(X)=\bar{f}_1(X)^{e_1}\cdots \bar{f}_r(X)^{e_r}$$
be the factorization of $f(x)$ in $A/\frak{p}$$[X]$. Then $$ \frak{p}=\frak{P}_1^{e_1}\cdots \frak{P}_r^{e_r}$$

$\textbf{[Extension of valuation]}$
Let $L=K(\theta)$, $f(x)$ be a minimal polynomial of $\theta \in K[x]$ and $v$ be a valuation of $K$
and $$ f(X)=f_1(X)^{m_1} \cdots f_r(X)^{m_r}$$ be the decomposition of $f(x)$ into irreducible factors over the completion $K_v$. Then there is the valuation $w_1, \ldots , w_r$ extending $v$ to $L$ (corresponding the irreducible factors $f_i(X)$)

[My question]
I have some intuition that each prime ideal and valuation correspond.
So, I know that the two Theorems above make sense to some extent.
However, one is to observe the factorization of f(x) in the residue field, and the other is to observe the factorization of f(x) when the base change is made to completion.
These two concepts are completely different. ( quotient and base change to completion)
Is there any reason for this connection?
 A: There are two steps involved in the translation.
First is the step from prime ideals to valuations. Let $\mathfrak{o}$ be a Dedekind domain with field of fractions $K$. Then to every nonzero prime ideal $\mathfrak{p}$ of $\mathfrak{o}$ we may associate a $\mathfrak{p}$-adic valuation $v_{\mathfrak{p}}$ on $K$, as follows: starting with $a \in K$, we have a factorisation of the fractional ideal $(a)$ into a product $\prod_{\mathfrak{p}} \mathfrak{p}^{v_{\mathfrak{p}}}$; we then set $v_{\mathfrak{p}}(a)$ to be that integer $v_{\mathfrak{p}}$.
If $L / K$ is now a finite extension, and $\mathfrak{p}$ decomposes as $\mathfrak{P}_1^{e_1} \cdots \mathfrak{P}_r^{e_r}$, then the valuations $w_i = e_i^{-1} v_{\mathfrak{P}_i}$ are precisely the extensions of $v_{\mathfrak{p}}$ to $L$. It is easily seen that the notions of ramification index and inertia degrees, defined for extensions of primes and extensions of valuations, match up.
The valuation-theoretic approach has some advantages. For one, we have the Archimedean valuations, which have no obvious analogue in terms of prime ideals. But this is beyond the scope of this answer. Another advantage is that we can now pass from the extension $L / K$ to the completions $L_{w} / K_v$ (called a 'local-to-global principle' even though you're going global to local here). The world of complete fields is easier in some respects, so it's advantageous to be able to do this.
Moving to the second step, which is from quotients to completions. As remarked in the comments, the key here is Hensel's lemma. Let $K_v$ (the slightly awkward notation is deliberately suggestive) be a field which is complete with respect to a non-Archimedean valuation, and let $\mathfrak{o}_{v}$ be the valuation ring with residue field $\mathfrak{o}_{v} / \mathfrak{p}$ at the maximal ideal $\mathfrak{p}$. If $f(x)$ is a primitive polynomial in $\mathfrak{o}_{v}[x]$ which factorises as $\overline{f_1}(x)^{e_1}\cdots \overline{f_r}(x)^{e_r}$ modulo $\mathfrak{p}$, then in fact $f(x)$ already factorises in $K_v$ as $f_1(x)^{e_1} \cdots f_r(x)^{e_r}$ --- and $f_i(x)$ modulo $\mathfrak{p}$ is precisely $\overline{f_i}(x)$.
