On 3 July 1776, John Adams wrote home to his wife Abigail, excited that the Continental Congress had finally voted for independence the day before. He said:
The Second Day of July 1776, will be the most memorable Epocha, in the History of America. I am apt to believe that it will be celebrated, by succeeding Generations, as the great anniversary Festival. It ought to be commemorated, as the Day of Deliverance by solemn Acts of Devotion to God Almighty. It ought to be solemnized with Pomp and Parade, with Shews, Games, Sports, Guns, Bells, Bonfires and Illuminations from one End of this Continent to the other from this Time forward forever more.
You will think me transported with Enthusiasm but I am not.—I am well aware of the Toil and Blood and Treasure, that it will cost Us to maintain this Declaration, and support and defend these States.—Yet through all the Gloom I can see the Rays of ravishing Light and Glory. I can see that the End is more than worth all the Means. And that Posterity will tryumph in that Days Transaction, even altho We should rue it, which I trust in God We shall not.
But, of course, we don't celebrate the 2nd of July that way. We celebrate the 4th. And people started celebrating the 4th soon after Adams wrote. In 1783, for example, Boston changed the date of its annual oration from the 5th of March, anniversary of the Boston Massacre, to the 4th of July; the wound of the Massacre had been healed by independence, town fathers implied.
So why do we celebrate the 4th of July? Because that's the anniversary of Congress's public declaration of why it had adopted independence two days before. The declaration in its many printed versions of the 1700s (hardly anyone saw the signed manuscript or a facsimile of it until fifty or more years later) usually started out, "In Congress, July 4, 1776." That dateline couldn't help but cement the 4th of July in people's minds.
And in a way the shift of focus from the 2nd to the 4th makes sense. The legal move of voting for independence in a closed legislature isn't so republican as the people's adoption of independence for themselves.