Various information collated from Wikipedia.
300 is a film adaptation of the graphic novel 300 by Frank Miller, which itself is based on the Battle of Thermoplae in 480BC. In that battle, an alliance of Greek city-states fought the invading Persian Empire army at the pass of Thermopylae in central Greece.
With a small force led by King Leonidas of Sparta, the Greeks held the massive army of Xerxes I back for 3 days even though they are vastly outnumbered. However, a local resident named Ephialtes betrayed the Greeks by revealing a mountain path that led behind the Greek lines. Dismissing the rest of the army, King Leonidas stayed behind with 300 Spartans and 700 Thespian volunteers. Eventually, the Persians succeeded in taking the pass but they sustained heavy losses that are extremely disproportionate to those of the Greeks.
The fierce resistance of the Spartan-led army offered Athens the invaluable time to prepare for a decisive Naval Battle of Salamis, which left much of the Persian Empire’s navy destroyed. Xerxes I was then forced to retreat back to Asia, leaving his army in Greece under Mardonius. Soon, the Spartans assembled at full strength and led a pan-Greek army that defeated the Persians decisively at the Battle of Plataea, ending the Greco-Persian War and with it Persian Empire expansion into Europe.