How to approximate the transfer function of compensator using root locus?
K is the gain parameter for which you will be at any particular point on the root locus. As you increase K, the closed loop poles will start from the open loop poles and move toward the open-loop zeros as depicted in the root locus showing all possible locations of closed loop poles versus gain K.
This is because the general form for the closed loop and open loop gain in a general loop equation is related as:
$$G_{CL}(s) = \frac{G_F(s)}{1+K G_{OL}(s)}$$

Where $G_{CL}(s)$ is the closed loop gain, $G_{F}(s)$ is the forward gain from input to output and $G_{OL}(s)$ is the open loop gain with the real gain $K$ pulled out as a independent variable that we will sweep when creating the root locus plot.
The denominator of the closed loop gain is called the &quot;characteristic equation&quot; and given properness of realizable causal systems (properness means the number of zeros is always less than or equal to the number of poles, not including poles and zeros at infinity), we can determine all loop characteristics (stability, dynamics, etc) from the characteristic equation alone. To really see what is occurring in the root locus plot, consider this equation expressed in terms of poles and zeros of the open loop gain $G_{OL}(s)$ as follows:
$$1+KG_{OL}(s) = 1 + K \frac{G_z(s)}{G_p(s)}$$
Where $G_z(s) = (s-z_1)(s-z_2)...$ is the polynomial of open loop zeros, and $G_p(s) = (s-p_1)(s-p_2)...$ is the polynomial of open loop poles. This is rearranged to be:
$$= \frac{G_p(s)+KG_z(s)}{G_p(s)}$$
Since this equation is in the denominator of the closed loop gain $G_{CL}(s)$ then the roots of the numerator (the zeros of this equation) will be the poles in the closed loop gain!
Knowing that, consider when $K$ is varied from very large to very small: When $K$ is very small then $G_p(s)$ dominates the equation $G_p(s)+KG_z(s)$ and therefore dominates the poles of the closed loop gain. Specifically in this case of very small $K$, the poles of the open loop gain will be the poles of the closed loop gain.
Similarly, when $K$ is very large then $G_z(s)$ dominates the equation $G_p(s)+KG_z(s)$ and therefore dominates the poles of the closed loop gain. Specifically in this case of very large $K$, the zeros of the open loop gain will be the poles of the closed loop gain.
This is why the poles start at the open loop poles and move toward the open-loop zeros in the root locus.