The earliest factories, at least in the U.S., were located not in great cities but near bodies of water that could be harnessed to power them. At first, the factory, such as Lowell Mills in Massachusetts, was a modern innovation in an otherwise rural backwater but it drew in young women bored with farm life and provided them with jobs and their own money, discipline, and even a form of education with a library, lectures, and an on-site magazine. Restrictive rules and regulations mitigated the sense of freedom the girls enjoyed, but they formed bonds and even spoke up against the increasing pace of work in the face of rising competition.
Over time immigrants hungry for work replaced women in factories and they brought urban values with them and factories became like little cities until cities themselves overtook the factories. Hierarchies in the factory became strident and were reflected in the surrounding towns. Immigrant enclaves provided variety to the towns but also sparked tensions between ethnic groups and different social classes.
Urban blight due to the factories’ output and workers’ living conditions became the norm. Ever-increasing swaths of air, land and water became blighted due to the waste from factories and soot from their stacks. Still, factories provided jobs for women and men, Americans and immigrants, poor and middle-class whites and nonwhites. It brought all together yet still separated them by tasks and levels of authority. White middle-class males fared the best but that has changed over time.
The steam powered loom was followed by the water-driven looms of the early 19th century and the huge explosion in productivity that came about because of automated functions and a massive influx of cheap labor was a direct result of that automation. Much of the changes came about because of increased ability to mechanize functions that used to take skilled craftsmen long hours to accomplish and thereby negated the need for skilled craftsmen and replaced them with machines and unskilled labor.
Much of the change came about as industrialists and capitalists saw the massive increase in profits that could be achieved by streamlining production and significantly lowering production costs while simultaneously lowering prices and increasing demand for a product.
When the steam powered loom was invented at the end of the 1700s factories were able to produce cloth 1000x faster than by hand in the cottage industry. This new efficiency brought new profitability which in turn created a rush to build more and more factories. The factories were usually clustered in cities which became increasingly crowed and polluted due to the influx of workers from the surrounding countryside and the pollution produced by the burning of the coal to power the machines.
As the industrial revolution progressed more factories sprung up to produce the needed building materials and the industrial revolution moved beyond textile manufacture into the realms of building materials like iron and steel.