What is the origin of Grendel's conflict with King Hrothgar and the Danes?
Within the first 100 lines of Beowulf, we learn that Grendel hates the joy and camaraderie that characterizes the Danes' celebrations in Hrothgar's hall Heorot:
Then this mighty spirit who in darkness abode/angrily endured the pain/when every day he heard rejoicing/loud in the hall. . . . (ll. 86-89)
In other words, Grendel cannot stand to hear the joyous sounds of men who are celebrating their victories. For a reason as yet unstated, Grendel appears to hate these men and their celebrations because he is not a part of that group. More important, the poet tells us that the celebrations in Heorot cause Grendel pain or anguish. Grendel resents what he cannot have, and the question is, what has happened to Grendel to make him so resentful?
A few lines later, we learn the reason:
With fulsome monsters/this sorrowful man had stayed awhile,/Since the Shaper [that is, God] had condemned him/As Cain's kinsman . . . for the Measurer banished him [that is, Cain] for his crime, away from humankind. (ll. 104-110)
Grendel is related to Cain, who killed his brother Abel and was banished by God from the rest of mankind for the murder. Grendel, as Cain's kinsman, was banished
. . . away from humankind./Misbegotten creatures came to life then . . . who fought with God/a long time (ll. 110-114)
Grendel's hatred, then, originates with his banishment from the world of men to a world populated with monsters who are at war with God and, by extension, also at war with men like Hrothgar, the Danes, and Beowulf and the Geats.
The irony inherent in Grendel's situation is that he desperately wants to be a part of the world of men, but can never be part of that world because he is forever condemned to the world of monsters as a relative of Cain. And we need to keep in mind that Grendel was cast out of the world of men not because he had done anything horrible himself but because he was related to Cain. In 21stC. terms, Grendel was "collateral damage."
Grendel's desire to join the world of men turns to destructive rage when he understands that, no matter what he does, he is forever banned from associating with men and sharing their joys.