There are various versions of the origins of Wing Chun Kuen but no-one knows for sure as there are no written records as the legend was passed down verbally from master to student.
During the Qing Dynasty period Southern China was in turmoil and many rebellious groups hid there and concealed their true identities from the ruling Qing government. These rebellious groups where supporters of the old Ming Emperors and their descendants, and they sought to overthrow the Qing. Many of them were the survivors of the armies, trained in Shaolin Kung Ku, that were defeated by the Qing. These rebels formed Unions / Associations / Societies as a cover for there activities. One of these Associations was called Hung Fa Wei Gun. This group had a large northern element, including the Hakka people, it was these that started an Opera Troop so they could travel around the country without causing suspicion. They taught the southern people Opera and their Shaolin Kung Fu. After a time the Qing government found out about this and closed the Association down forcibly. It was many years before the people dared to start an Opera Troop again. They eventually did and called the Association “King Fa Wei Gun”. This became a centre for Opera and Martial Arts training. After a few years the King Fa Wei Gun purchased two Junks for the Opera troops to travel around the country.
The rest of the article is here, and there is some more here. (hat tip to Emlyn at Jianghu)