The quarrels between the Pope and King Henry were complex, but I will summarize here.
Henry was incredibly young when he became king, as young as 15. He immediately wanted to have more control over the Church, which Gregory was not a fan of.
In short, the conflict was about who got to appoint Church officials. Henry thought he, as king, had the right to appoint bishops and the like in the German Church. Gregory opposed this idea, solely because he wanted the power for himself.