The Lee Resolution legally declared the thirteen colonies independent before the Declaration was adopted.
Richard Henry Lee of Virginia introduced the proposal in the Second Continental Congress on June 7, 1776. Congress debated the matter and approved the resolution on July 2, declaring that the United Colonies were free and independent states.
The Declaration of Independence followed on July 4. Its purpose was to explain and justify the decision already made through the Lee Resolution, listing grievances against King George III and presenting arguments about rights and government.
This distinction explains why some historians describe July 2 as the legal independence date, even though Americans celebrate July 4. John Adams predicted that July 2 would become the great annual anniversary, but the date printed on the widely circulated Declaration made July 4 the lasting national holiday.