Achilles wants to revenge for Patroclus’ death. Hector killed Patroclus and took his armor (which initially pertained to Achilles). Achilles is mourning his close friend and promises not to eat and not bury Patroclus’ body as long as Hector is still alive.
Achilles refused to fight for the Achaeans more than once. When Odysseus, Great Ajax, and Phoenix visited him with treasures from Agamemnon, he did not take the offerings and rejected all their requests. The only emotion that could motivate him to step back into the ranks was rage. This wrath to Hector, the one who killed Patroclus, replaced the anger to Agamemnon. Probably, losing a friend was more painful than losing a woman for Achilles.
However, no ancient myth goes without gods’ intervention. Zeus predicted that Hector would die after he kills Patroclus. That is why the chief god did not do anything to save Hector. Besides, Patroclus killed Zeus’ son, Sarpedon. This series of deaths no longer touched the god.
He gave the green light to other deities who were supportive of the Achaean side. Apollo pretended to be Hector’s brother and talked him into fighting Achilles. Hector threw his spear at the enemy but missed. When he returned to ask his brother for another weapon, there was no one there. Achilles threw his spear at Hector and made it into his neck, which was not protected by armor.
Hector’s death did not satisfy Achilles’ anger. He dragged Hector’s corpse by the legs around the city walls and Patroclus’ funeral mound.