Before and during Madison's time in office, the relations between the United States and Great Britain became worse. The British continued 'impressment' which was a policy of conscripting U.S. sailors against their will to serve in the British Navy.
This aggravated Madison and Jefferson before him. For a long time, Adams was able to hold off the populist rage against Britain and resist war. Jefferson imposed the disastrous tariffs that almost made New England secede. Madison continued these restrictions on trade and the conflict eventually reached a boiling point.
Madison and the nationalist Republicans pushed for war and sold it to the American people by convincing them that they could easily invade British Canada and force them to come to terms.
The American people weren't completely sold on the idea of a fight with the British (still the most powerful military in the world) but went along with 'Mr. Madison's War' as they called it. The Republicans now had their war, but the problem came when they didn't properly fund the Army, preferring to rely on militias for ideological and economic reasons.
The militias turned out to be ineffective as an invading and national defense force since they often refused to fight outside of their own state. The irony of this is that Madison wrote about this problem in the Federalist papers describing the Militias as inadequate for national defense.
Detroit was captured along with Washington D.C. and the White House was burned to the ground. Right before he torched the place, Admiral George Cockburn (yes, that's his real name) held up his glass and gave a toast to 'Jemmy's health. For some reason, I don't remember seeing the White House in flames in my early history classes.