For prime numbers $p_k$ you have $\pi(p_k)=k$, exactly.
Because the prime number theorem gives the approximation $p_k \sim k\log k,$ then the number $x$ for which $\pi(x)=k$ is approximately $k\log k$ with an known associated error.
Any $x$ in the interval $p_{k}\leq x<p_{k+1}$ gives $\pi(x)=k,$ so as you might expect,
$p_k\sim x\sim k\log k,$
and as you might or might not expect, $p_k\sim p_{k+1}.$ When implementing an algorithm using the p.n.t. approximation it may be important to keep the error in mind. Dusart's error bounds are very useful.