A crucial and widely encompassing aspect of the heroic code in The Iliad is the sacred oath—the reason why Helen's former suitors have all come together at great personal cost to fight the Trojans as allies of her husband, Menelaus. Hesiod is one of the ancient sources who provides this background plot setting to the epic. Much of the loyalty we see in the Iliad relates directly to this sacred oath.
Helen is the daughter of Zeus (in swan form) and Leda (a mortal married to Tyndareus, King of Sparta). As a demi-goddess and a princess of astounding beauty, Helen attracts many noble and powerful suitors. Tyndareus is afraid to choose among them for fear of retaliation—both against himself and the suitor who is selected.
Odysseus happens to be one of the suitors and comes up with a clever plan that helps Tyndareus solve this problem. All the suitors must agree to take a sacred oath of loyalty to the man who becomes Helen's husband. Tyndareus seals the oath with the sacrifice of a horse (a highly sacred ritual). Heroic code forbids the breaking of an oath, and it is widely understood in the culture that oath-breakers risk the wrath of the gods.
When Paris, prince of Troy, absconds with Helen, the Achaeans (combined Greek forces) have no choice but to honor their oath and support Helen's husband, King Menelaus of Sparta, in his war against Troy. (Tyndareus abdicated and appointed Menelaus as King of Sparta.) Hesiod tells us that Achilles was not one of the suitors, as he was too young at the time. His motivation for joining the Achaean forces is related to the heroic code—the quest for eternal glory.
Born with extraordinary gifts of speed and martial ability, Achilles is "the best of the Greeks." He becomes deeply offended when Agamemnon breaks a heroic code and takes Briseis, the captive who (in accordance with the established rules of war) Achilles claims for himself from the raid of Chryse, a town allied with Troy. Agamemnon is forced to give up his own captive, Chryseis (daughter of a priest of Apollo), after Apollo sends a plague. Agamemnon breaks a heroic code when he then takes Briseis from Achilles as compensation. This action offends Achilles (who is not oath-bound to participate in the war) and causes him to withdraw from the fighting, with disastrous results.
In terms of hospitality, the ancient Greek culture considered the concept of xenia, or "guest-friendship," as a religious obligation as well as an unquestioned aspect of the heroic code. Xenia was based on the belief that a stranger might be a god or goddess in disguise. We see an analogous concept in the Old Testament (Hebrews 13:2): "Do not neglect hospitality, for thereby some have entertained angels."
The bonds of friendship under the heroic code in the Iliad include the responsibility for avenging the death of a friend or loved one. Driven mad by grief and a sense of guilt, Achilles takes this idea to an unacceptable extreme in his treatment of Hector, the Trojan prince who kills Patroclus in battle. Patroclus and Achilles have been inseparable companions, and the love between them runs deep. Although the Trojans honor a heroic code when they permit a twelve-day cessation of fighting so that the Achaeans may properly mourn Patroclus, Achilles does not respect this code when he defeats Hector in battle.
The rage (in Greek, menin) of Achilles (as well as a sense of guilt for the death of Patroclus) blinds him, and he breaks the heroic code that requires respectful treatment of the body of a deceased enemy combatant. Achilles kills Hector in battle but then shamefully desecrates his body by tying it to his chariot and dragging it behind him. He refuses to hand over Hector's body to his family for proper burial, without which his soul cannot find peace.
This is such an egregious violation that Zeus finally intervenes and sends Hermes, the messenger god, to accompany Hector's father, King Priam, to the Achaean camp where he humbles himself before Achilles to beg for the return of Hector's body. Achilles is moved and consents.
The heroic code in The Iliad overlaps the rules of honorable behavior within the culture and adds certain rules related specifically to warfare.
In the Iliad, the heroic code is seen through the bond of friendship, the customs of hospitality, and the concept of loyalty and courage of battle.
The belief in hospitality customs carried great weight in the time of the Iliad. Paris kidnaps Menelaus' wife Helen while Menelaus is showing acts of kindness and hospitality to Paris. Paris commits a great offense by disregarding Menelaus' hospitality:
Paris visits Menelaus in Sparta and abducts Helen, taking her back to Troy with him, seemingly with her active cooperation. Paris also takes a large part of Menelaus’ fortune. This was a serious breach of the laws of hospitality, which held that guests and hosts owed very specific obligations to each other. In particular, the male guest was obligated to respect the property and wife of his host as he would his own.
Paris' total disrespect to Menelaus causes the Trojan War.
During the Trojan War, various heroes showed significant courage and loyalty in battle. Achilles is a great hero in the Trojan War. However, Achilles' tragic flaw causes him to break loyalty with the Greeks. Achilles allows his pride and anger at Agamemnon to influence his decision to stop fighting the Trojans. When Achilles stops fighting, the Greeks begin losing. They suffer many losses of Greek soldiers.
Because of an argument between Achilles and Agamemnon, Achilles decides to stop fighting the Trojans. Later on, Patroclus is killed by Hector. Achilles and Patroclus were great friends. When Hector kills Patroclus, Achilles avenges his death by killing Hector. It is the bond of friendship that causes Achilles to reenter the Trojan War. Truly, the bond of friendship was of great importance during the time of the Iliad.
No doubt, the heroic code was an important concept during the time of the Iliad. If characters broke the heroic code, there were serious consequences. Also, it was during this time that it meant everything to a soldier to be considered heroic. Even if it meant dying, the hero lived by the honorable code. He was determined to live up to the high ethical standards associated with the heroic code.