Apollo helps Hector and the Trojans because the god is angry at the Greeks for dishonoring his priest. According to Homer:
And which of the gods was it that set them on to quarrel? It was the son of Jove and Leto; for he was angry with the king and sent a pestilence upon the host to plague the people, because the son of Atreus had dishonoured Chryses his priest.
Apollo is the son of Jove and Leto. Chryses, his priest, had come to the Agamemnon, the son of Atreus, to beg for the release of his daughter. Agamemnon treats the priest with extreme discourtesy and even threatens him with violence. But in the end Agamemnon is forced to give up Chryses' daughter. This results in the most important event in the entire Iliad. Agamemnon takes Achilles' maid of honor as a replacement for the girl he had to give up. These "maids of honor" are actually captive Trojan girls who are used as sex slaves. Agamemnon tells Achilles:
"...but I shall come to your tent and take your own prize Briseis, that you may learn how much stronger I am than you are, and that another may fear to set himself up as equal or comparable with me.”
Achilles, who is by far the Greeks' greatest warrior, is so outraged that he refuses to fight the Trojans any longer. He spends most of the epic poem lounging in his tent. His absence from the battlefield is devastating to the Greeks. They are in danger of being annihilated by the Trojans led by Hector.
Homer shows his artistry in starting his poem with this conflict between Agamemnon and Achilles. Homer eliminates the Greek's greatest warrior from much of the action, only to bring him back onto the battlefield near the end in a high rage after Hector slays his friend Patroklos. This leads to an engagement between the two heroes, Achilles and Hector. When Hector is killed there is great mourning in Troy because everyone feels that they are now destined to lose the war.
Shakespeare includes comical scenes in which Achilles is lounging in his tents in the play Troilus and Cressida.