Poseidon gave the two horses to King Peleus of Phthia, as a wedding gift when Peleus married the Ocean goddess, Thetis. Peleus later gave the horses to his son Achilles who took them to draw his chariot during the Trojan War.
Book 16 of the Iliad tells us that Achilles had a third horse, Pedasos (maybe "Jumper", maybe "Captive"), which was yoked as a trace horse, along with Xanthus and Balios. Achilles had captured Pedasos when he took the city of Eetion. Pedasos was mortal, but he could keep up with the divine horses. Sarpedon, prince of Lycia and ally of Troy, killed Pedasos when his spear missed Patroclus. Achilles' comrade-in-arms Patroclus used to feed and groom these horses. In the Iliad, it was told how, when Patroclus was killed in battle, Xanthus and Balius stood motionless on the field of battle and wept.
At Iliad 17.474-8, Automedon, Achilles' charioteer, states that only Patroclus was able to fully control these horses. When Xanthus was rebuked by the grieving Achilles for allowing Patroclus to be slain, Hera granted Xanthus human speech allowing the horse to say that a god had killed Patroclus and that a god would soon kill Achilles too. After this, the Erinyes struck the horse dumb.
Based on fragments from Alcman and Stesichorus, an alternative story of the horses can be derived.[1] The horses, named Xanthus and Cyllarus are the sons of Poseidon, who gave them to Hera as a gift. The latter bestowed them onto the Dioscuri to use as their horses in battle, and Xanthus retains his ability to speak with Castor.[1]