The tradition of celebrating this date began 1916 at the Stockholm Olympic Stadium, in honour of the election of King Gustav Vasa in 1523, as this was considered the foundation of modern Sweden.
Some question the validity of this as a national holiday, as it was not observed as a holiday until decades later. However this event does signify the end of the Danish-ruled Kalmar Union, so in a sense it is a marking of Swedish independence, though the event occurred so long ago that it does not have as strong of a presence in the social consciousness as does, for example, Norway's Syttende Mai (17 May).
In 2005 it became an official Swedish public holiday, replacing Whit Monday. This change led to fewer days off from work (more working-days) as 6 June will periodically fall on the weekend, unlike Whit Monday, which was always celebrated on a Monday. This has in turn led to complaints from some Swedish unions.