After several military conflicts with Great Britain (such as the Battle of Bunker Hill), the American colonists officially declared their independence from Great Britain. This was thanks to Thomas Jefferson and his writing of the Declaration of Independence. From there, American colonists fought to get rid of British influence in the US.
The American colonists were not nearly as strong or organized as the British military. However, the colonists did get help from other European countries (like Prussia and France) who supplied them with ammunition and training techniques. On the other hand, the British military did not really care about maintaining control of the American colonies. Their lack of desire showed on the battlefield, as they were defeated by the Americans.
Americas fight against Great Britain helped to form a national identity. This national identity would revolve around fighting against tyranny, giving individual freedoms/liberties to the citizens, and having a country where men can pursue "life, liberty, and the pursuit of happiness."