After leaving the Army he returned to Scotland where he trained as a fitter. As a skilled artisan, he became active in the labour movement and became familiar with the thought of Thomas Carlyle, a Scottish socialist. He became active in socialist circles, joined the Scottish Land & Labour League and met William Morris, a leading figure in European socialism, in Edinburgh.
He settled in Johannesburg, which had become a major mining settlement after the discovery of gold in 1886, and became active in the Labour Union, launched in August 1892.
During the 1890s Bain was politically active in a range of ways, including spying for the Kruger government in the Transvaal and Natal. He became editor of the Johannesburg Witness in 1899 and became a leading figure in Johannesburg Trades Council (founded October 1893). With Tom Mathews (Cornish-born ex-US mining union activist in Butte, Montana) and Johannesburg Trades Council's secretary Robert Noonan (aka Robert Tressell, author in 1914 of The Ragged Trousered Philanthropists) he founded the International Independent Labour Party.
When the Second Boer War broke out between the ZAR and Britain in October 1899, Bain joined the Transvaal forces and fought for his adopted country. On 31 July 1900, the day Johannesburg fell to the British, he was captured there and faced the prospect of a charge of treason, but was eventually treated as a POW on the basis of his naturalisation to the Transvaal. He was held in Ceylon, and after his release in 1903 returned to Johannesburg.
From then to 1905 Bain maintained a low profile in the labour movement. But in 1906 the Transvaal Independent Labour Party was formed and, after its merger with another grouping, Bain was elected president. Bain went to work on a mine outside Pretoria in 1908 and remained active in politics and trade unions.
On 4 July 1914, in a meeting between the strike leaders, Prime Minister Louis Botha and then-minister Jan Smuts, agreement was reached on the basis of full reinstatement of all miners who had been dismissed and an undertaking by the government to consider all the grievances of the trade unions. Botha and Smuts managed to persuade the mine owners, and the settlement was concluded.
However, Smuts was to have his revenge for the 'defeat' of 1913. A railway strike declared (without Bain's approval) in January 1914 led Smuts to mobilise his newly organised citizens' forces and seize key railway institutions. A general strike was proposed, but on 10 January a warrant for Bain's arrest was issued. Bain and fellow labour leaders barricaded themselves into their headquarters and on 13 January the Federation announced that affiliated unions had balloted in favour of the strike. However, on 15 January the Trades Union building was surrounded by police and soldiers, including artillery, and Bain and his colleagues had no option but to surrender. In February he was deported to Britain.