I had a boss tell me this and it was because he couldn’t unlock the right budget bucket to pay me more unless I first indicated a documentable fact that I was leaving. Apparently his hands were tied above him…so I did it. I actually didn’t have a job lined up, but gave my two weeks, got a 20% raise…and then still left 6mos later for greener pastures.
But my rapport with my boss was pretty good at the time, so it was pretty clear when he said what he said that there was reason.