The famous 300 at Thermopylae were never fighting alone
Leonidas is remembered for leading 300 Spartans against Persia, but he marched with about 1,200 men and commanded several thousand allied Greeks. When the pass was betrayed, he stayed behind with his Spartans, helots, Thebans and 700 Thespians who chose to share his fate.
Leonidas was never expected to rule. Herodotus says his mother, who was also his father's niece, stayed childless so long that Sparta's ephors pressed King Anaxandridas II to take a second wife without divorcing the first. The new wife bore Cleomenes, and a year later the first wife produced Dorieus, then Leonidas, and either a younger brother or twin, Cleombrotus. Cleomenes took the throne; Dorieus left in fury, failed to found a colony in Africa and died in Sicily. Leonidas married Cleomenes's daughter Gorgo and became king around 489 BC, ruling alongside Leotychidas II.
A product of the harsh agoge training, he once answered a critic who said only his crown set him apart: were he not better, he would not be king, a remark taken to mean he had earned his rank. When the Greek states united against Xerxes in 481 BC, they chose him as commander, and two years after his death they preferred Athenian leadership over other Spartans, which suggests they wanted him personally.
In August 480 BC he led 300 Spartan hoplites and 900 helots north, gathering a force of perhaps 4,000 to 7,000 Greeks. Herodotus put the Persian army above two million; modern estimates run from 70,000 to 300,000. For four days the Persian king held back, hoping the Greeks would scatter. For two days of assaults the defenders held the narrow pass and two of Xerxes's brothers fell.
On the seventh day, 11 August, a local Greek named Ephialtes guided Persian troops along a mountain track behind the Greek line. Leonidas dismissed most of the army and remained with the rest; the Thespians under Demophilus refused to leave him. He was killed early on that final day and his son Pleistarchus succeeded him. The battle was lost, but a year later the Greeks drove the Persians out.
Source: Leonidas I