If America got their independence from Britain on July 4 1776, then why did that war continue for 5 years?

Surely Independence means a light switch, no? Mexico got independent from Spain immediately on September 27 1821, ditto Brazil from Portugal September 7 1822, and Jamaica from Britain on August 6 1962.

Look I'm not American, so could a history enthusiast please educate me on this?

Did that Independence document just come in handy or something?
Updates
1 y
I think October 19 (Battle of Yorktown 1781) would be a more suitable Independence Day holiday for Americans. But that's just me.
If America got their independence from Britain on July 4 1776, then why did that war continue for 5 years?
Post Opinion