Before the end of the 1700s, the United States did not exist. It was only 13 colonies on the continent of North America which were under the control of King George III of Britain.
The colonies found that it was difficult to be under the control of a king who was too far away from them. They wanted to be free. They wanted to set up their own government.
A war started. After years of fighting, on July 2, 1776 the Declaration of Independence for the 13 colonies was written.
However Independence Day is now celebrated on July 4, because that is the day the Declaration of Independence was officially adopted.
The 13 colonies of North America were then free from the control of the British King. However the war did not end in 1776. It was still on till 1783. In 1783 Independence Day became an official holiday in the United States.