It does not mean "hold a grude' as such.
We have a simple phrase, 'in for'
as in "We're probably in for some rain", meaning due for, in line for; about to receive.
We might then say, "You're in for a belting when Dad gets home" (because he's been naughty, broken something etc - pre-child abuse laws!)
Thus, the person on the receiving end is 'in for it' when Dad gets home.
If then, John does something to enrage Paul, and Paul is going to unleash his anger on John in some way next time he sees him, whether in words or bashing him up, we say that "Paul has got it in for John." or "He has it in for John."