Ganelon's hatred for Roland can be traced to two sources. The first is his wounded pride at living in Roland's shadow; the second is his being volunteered by Roland to accomplish a dangerous task.
We can observe evidence for the first source in how Ganelon and Roland respond in different ways to Charlemagne's request that a messenger embark on the dangerous journey to demand surrender of Marsilla, king of the Persians. Roland, and others of Charlemagne's select twelve, volunteer themselves, but they are rebuked by the emperor:
Nay - my sagest of men art thou: By my beard upon lip and chin I vow Thou shalt never depart so far from me: Sit thee down till I summon thee. (stanza 17)
Charlemagne is, in a sense, playing favorites. In broad view of all the soldiers, he refuses to allow certain men to risk their lives on an errand. In doing this, he preserves them for greater acts of glory. Thus, Ganelon feels undervalued because Charles does not value him as highly as the other men.
Then, after failing to hear anyone volunteer from outside his elect circle, he has Roland select someone to engage upon the task. Roland chooses Ganelon, who snarls at being assigned by a favorite of Charles' inner circle.