The rivalry between Achilles and Agamemnon in Homer's Iliad has two causes, one indirect and one direct.
The indirect cause has to do with the agonistic nature of oral traditional society, in which heroic figures competed over "kleos" or fame. Although Agamemnon was the leader of the Greeks, Achilles was the greater warrior. This put them at odds as Agamemnon wished to be most honored by virtue of his position and Achilles for his prowess.
The immediate cause of the dispute was over a girl, Chryseis, daughter of a priest of Apollo, who had been taken by the Greeks who were pillaging nearby towns. When Apoloo sent a plague against the Greek army, insisting that Chryseis be returned to her father, Agamemnon reluctantly agrees, but demands Briseis, another girl who was claimed by Achilles in her stead. Achilles i8s so angered by the affront to his honor that he withdraws from the fighting.
It all begins when the Greeks sack a town allied with the Trojans and take two maidens (Chryseis and Briseis). Achilles holds a meeting with Greek leaders to try and convince Agamemnon to let his girl, Chryseis, go. In a rage, he decides that since he pretty much is better than everyone else, he should have a girl no matter what, so he takes Achilles' girl, Briseis.
Achilles' reaction to this is very detrimental to the entire army. He withdraws from fighting and refuses to allow his troops to fight with the other Greek soldiers.