After industrializing and projecting itself economically, France became a threat to England, which at that time was the greatest industrial power in the world. To face Napoleon's France, England allied itself with Austria and Russia, countries that aimed to stop the advance of the ideals of the French Revolution in their territories. With that, in October 1805, Napoleon tried to measure forces with the British at sea, however the French fleet was destroyed in the Battle of Trafalgar.
On the other hand, a month and a half after In that battle on the mainland, the Napoleonic army defeated Austria at the Battle of Austerlitz and, the following year, defeated Prussia at the Battle of Jena. Soon after, Napoleon decreed the Continental Blockade in which all countries on the European continent were prohibited from trading with England and from receiving English ships in their ports.
In 1807, Bonaparte achieved another military and diplomatic success:after defeating the Russians in Polish territory, he forced Tsar Alexander I to sign the Treaty of Tilsit. In this agreement, Russia committed itself to respecting the economic blockade imposed on England and recognizing French hegemony in Europe.
In Portugal, the government of Prince D. João played a double game:officially it did not oppose the Continental Blockade, but, secretly, it continued to allow the entry of English products into its ports.
With the information that the small and impoverished kingdom of Portugal continued to maintain commercial ties with England, Napoleon ordered that it invaded. Faced with this, the Portuguese court moved to Brazil.