In the early 19th century parts of Wales became heavily industrialised. Ironworks were set up in the valleys running south from the Brecon Beacons particularly around the new town of Merthyr Tydfil, with iron production later spreading westwards to the hinterlands of Neath and Swansea where anthracite coal was already being mined. From the 1840s coal mining spread to the Aberdare and Rhondda valleys. This led to a rapid increase in the population of these areas.
The social effects of industrialisation led to bitter social conflict between the Welsh workers and the English factory owners. During the 1830s there were two armed uprisings, in Merthyr Tydfil in 1831, and the Chartist uprising in Newport in 1839, led by John Frost. The Rebecca Riots, which took place between 1839 and 1844 in South and Mid Wales were rural in origin. They were a protest not only against the high tolls which had to be paid on the local Turnpike roads but against rural deprivation.
Partly as a result of these disturbances, a government enquiry was carried out into the state of education in Wales. The enquiry was carried out by three English commissioners who spoke no Welsh and relied on information from witnesses, many of them Anglican clergymen. Their report, published in 1847 as Reports of the commissioners of enquiry into the state of education in Wales concluded that the Welsh were ignorant, lazy and immoral, and that this was caused by the Welsh language and nonconformity. This resulted in a furious reaction in Wales, where the affair was named the Treachery of the Blue Books.
Socialism gained ground rapidly in the industrial areas of South Wales in the latter part of the century, accompanied by the increasing politicisation of religious Nonconformism. The first Labour MP, Keir Hardie, was elected as junior member for the Welsh constituency of Merthyr Tydfil and Aberdare in 1900. In common with many European nations, the first movements for national autonomy began in the 1880s and 1890s with the formation of Cymru Fydd, led by Liberal Party politicians such as T. E. Ellis and David Lloyd George.
Another movement which gained strength during the 1880s was the campaign for disestablishment. Many felt that since Wales was now largely nonconformist in religion, it was inappropriate that the Church of England should be the established church in Wales. The campaign continued until the end of the century and beyond, with the passing of the Welsh Church Act 1914, which did not come into operation until 1920, after the end of the First World War.
The nineteenth century brought about a large increase in population as Wales, like the rest of the UK, largely attributable to high birth rates. In 1801 just over 587,000 people lived in Wales; by 1901, this had increased to over 2,012,000. The most significant rises in population occurred in industrial counties - Denbigh, Flint, Monmouth and Glamorgan. The century witnessed a transition from a society that was predominantly rural (around 80% lived outside urban settlements in 1800) to a largely urbanised, industrial society (in 1911, only 20% lived in non-urban areas).