The War of 1812 is sometimes called the “Second War of Independence.” This is because it was a war that was fought mainly to force the British to truly treat the United States as an independent country.
After the Revolutionary War, the former colonies became, of course, an independent country. However, they were still extremely weak. This meant that the British could do various things that one country should not do to another independent and sovereign country. First, the British kept forts in American territory in what was then called the Northwest. Secondly, the British used those forts as outposts from which to encourage Indians to attack American settlements. Finally, and perhaps most importantly, the British interfered with American shipping. They tried to prevent the US from trading with France when France and Britain were at war. They also “impressed” American sailors. This means that British naval ships stopped American merchant ships and, when they wanted to, took American sailors and forced them to serve in the Royal Navy.
All of these things were highly insulting to the Americans and they ended up causing the US to go to war.