How did the US get involved in the War of 1812? What were the lessons learned from that war?

How did the US get involved in the War of 1812? What were the lessons learned from that war?