In 1800, President John Adams ran against Thomas Jefferson for president, but lost. In his last weeks of office he appointed some men to be judges, but Jefferson became president before the commissions could be sent, and didn't let them be sent.
Marbury thought this was unfair so he asked the supreme court to issue a writ of mandamus
In 1789, congress passed a law that allowed people to start at the supreme court if they wanted a writ of mandamus
The supreme court agreed that Marbury should receive his commission, but disagreed that they had the power to issue the writ. The constitution lists specific cases that can start at the supreme court, so the 1789 law was unconstitutional.
With only one day left before Jefferson's inauguration, JamesMarshall was able to deliver most of the commissions, but a few including Marbury's were not delivered. The day after, March 4, 1801, Thomas Jefferson was sworn in and became the this President of the United States.
The decision in Marbury v. Madison greatly expanded the power of the Supreme Court by establishing its right to overturn acts of Congress, a power not granted by the Constitution.