To add on to the other answer:
The important qualities of a grudge are that it
- is due to some perceived past insult or injury
- has been going on for some time
- inspires a desire for some kind of petty revenge
Rancor is just a fancy word that means ill-will/ill-feeling, but with more hate/anger. Feelings of rancor are unlikely to change quickly or easily. You may have feelings of rancor as the result of having a grudge towards someone, or these feelings might help you sustain the grudge, but these are still two separate concepts.
Ill-will is generally synonymous with dislike, although it is usually due to some incident. For example, you can dislike someone "on sight" (because of appearance or manner or circumstance) but you would not have ill-will toward them unless they caused you some minor insult or injury.
Either way, "having ill-will" is much milder than "holding a grudge". With ill-will, you may or may not want to take some kind of small revenge.
For example: A few years ago an older man hit my wife's car while backing up. While he was clearly the one at fault, he refused to pay for the repairs to her car for some time (almost a year), insisting that the estimate she got from the repair shop was too high. Even though she got a couple of estimates, all around the same price, he refused to pay. We felt he didn't understand how expensive car repairs are these days, even for relatively minor damage, because many parts of the outer body are plastic, not metal, and can't just be "popped back into place". They have to be completely replaced.
Eventually we had to get the repairs done through our insurance company, which was both a hassle and, in the long run, more expensive.
The point of this anecdote is that, while I do not hold a grudge toward this man, nor do I have any rancor toward him, I still bear him considerable ill-will for being so obstinate. If we were to ever meet him again, I would be polite, but not particularly friendly towards him.
Anyway. Not to complicate this list, but keep in mind there are many other synonyms for these words in addition to these three: malice, malevolence, spite, animosity, acrimony, antagonism, antipathy, animus, bad blood, hard feelings, hostility, etc.
You may find Merriam-Webster a useful resource for questions like this, because each dictionary entry includes a "choose the right synonym" section.
(Edit) I thought of another example:
I generally have ill-will toward anyone who downvotes my answers on ELL without explanation. I don't feel rancor towards them, but if I know who they are, I might hold a grudge and be tempted to downvote their answers out of spite.