Well, I have this problem since 2018. At the beginning, I played in games like PUBG and I noticed some cursor lags in game. I found out it was my CPU which was running at 100% usage at that time when the lag appeared.
Now, I bought a new CPU which is an I5 9600k (The previous CPU was a I5 6400), and this is a beast, but the lag didn't disappear. My CPU is running at 15-30% usage, temperatures are 40-62 C, drivers are the latest.
I linked a video bellow which shows the problem, I hope you guys can help me with it because it's really annoying sometimes.
The video: https://www.youtube.com/watch?v=oaGoCBDsSYs