Following Napoleon's defeat at the Battle of Leipzig earlier in October, Napoleon began to retreat from Germany into France and relative safety. Wrede attempted to block Napoleon’s line of retreat at Hanau on 30 October. Napoleon arrived at Hanau with reinforcements and defeated Wrede’s forces. On 31 October Hanau was in French control, opening Napoleon’s line of retreat.
The Battle of Hanau was a minor battle, but an important tactical victory allowing Napoleon’s army to retreat onto French soil to recover and face the invasion of France.
The Battle of Leipzig, the largest and bloodiest encounter of the Napoleonic Wars, began on 16 October 1813, raged for three days and ended with a decisive victory for the Sixth Coalition. Napoleon was forced to abandon central Germany to the coalition and hastily retreated westwards. His strategy was to regroup all his available forces on the shores of the Rhine, where his lines of communication would be shorter and his rear less likely to be threatened. The Emperor's concern was that his already battered army might be forced to fight against superior forces again, so he ordered that the retreat be carried out at great speed. Had the coalition managed to advance with more vigour in the days following the Battle of Leipzig, the already disorganised French army would probably have been destroyed, but the coalition armies themselves had suffered such high losses at Leipzig that they were in no position to launch an effective pursuit. With military action confined to secondary rearguard actions, Napoleon was able to install his headquarters at Erfurt on 23 October and began to reorganise his forces. On 26 October, he sent orders to the various corps, directing them to Frankfurt via Eisenach and Fulda. Their assigned destination was the city of Mainz, by the Rhine river.
The coalition was buoyed by the news that Bavaria, a former French ally, agreed to join the Sixth Coalition according to the Treaty of Ried concluded just before the Battle of Leipzig. This allowed the coalition to threaten the overall military position of the French by moving a 45,000 - 50,000 Austro-Bavarian army, under the command of Karl Philipp von Wrede, into Napoleon's rear, occupying Würzburg in Franconia. The small French garrison of Würzburg did not try to resist and instead barricaded themselves at the local citadel, allowing the enemy to occupy the town without a fight. From Würzburg, Wrede moved towards the strategic city of Hanau, along one of Napoleon's main retreat routes. Wrede’s advance guard reached Hanau on 28 October and took possession of the city, blocking Napoleon’s route to Frankfurt. Although Wrede probably assumed that the main part of the French forces was retreating along a more northerly road to Coblenz and thus expected to face a force of only 20,000 men, he did entertain hopes that he would be able to play a major role in the defeat of Napoleon. He also believed that the French army was completely disorganised, which was not true, and was closely followed by the main coalition army, the "Army of Bohemia", which was in reality much further away and not really in close contact with Napoleon's forces.
The Austrian and Bavarian army at the battle of Hanau comprised two army corps, one Austrian and one Bavarian, and numbered no less than 42,000 men: 33,000 infantrymen, 9,000 cavalrymen and 94 artillery pieces. They were under the overall command of Bavarian General Karl Philipp von Wrede.