At a young age, around the early 1960s, William Khanyile began selling the New Age newspaper in Pietermaritzburg. By then he was already interested in Marxism and took part in study circles on the issue. Very soon after, he joined the South African Communist Party (SACP) and became particularly interested in discussions on Marxism. He tried to apply Marxist principles to situations faced by the SACP unit where he was actively involved.
In 1963, Khanyile and Antony Xaba were arrested, detained and charged with belonging to a banned organisation, the African National Congress (ANC). He was sentenced to eight years in prison which he served on Robben Island. On his release in 1972, he was placed under a banning order and restricted to a village in the rural areas. In 1975 he was arrested again and held in solitary confinement for a year. This was followed by trial in 1977 but the trial collapsed and he was acquitted and released.
On his release he went into exile in Maputo and began working for the South African Congress of Trade Unions (SACTU). Then in 1979 he visited Moscow and spent a few months at the Higher Trade Union School. Very soon after going into exile he got married to Eleanor, a fellow activist. The five years they were married were a busy time and the couple spent little more than a year together. Between January and February 1980 Khanyile went to Sweden representing SACTU and met with representatives of local trade unions where he highlighted the plight of Black South Africans under Apartheid. On 1 May 1980, Khanyile and John Nkadimeng led a SACTU contingent as part of the massive May Day march of workers through the streets of Maputo.
On 30 January 1981, Khanyile was killed in Matola, Mozambique, during a cross border raid by South African Defence Force members. A rocket was fired at point-blank rage through his bedroom wall while he was sleeping. During the raid, which became known as the Matola Raid, 15 other South Africans were killed along with a Portuguese national.