What caused the rise of "factory farms"?

An interesting insight into one of the key factors that precipitated  the development of "factory farms" from Maureen Ogle's forthcoming book In Meat We Trust

World War II also drained American agriculture of its labor supply, a fact that, as we'll see later, would have a profound impact on the way farmers raised livestock. Even before the United States entered the war, factories had geared up to supply warring countries with materiel, and men and women decamped from the farm for jobs those factories provided. In Georgia alone, between 1937 and 1941, 30 percent of agricultural workers left farm for factory. The shortage worsened after the United States declared war in late 1941. Everywhere in rural America, from dairy farms to cattle-feeding operations, from corn belt hog lots to rural Georgia chicken coops, labor vanished. When labor cannot be found, humans make a logical decision: they replace it with machinery. Americans had a long-standing tradition of doing so. For most of the nineteenth century, for example, the country suffered chronic shortages of labor that fostered a national passion for mechanization and automation. So, too, in the 1940s. Factory farming already had plenty of support both in and out of agriculture, and World War II affirmed that enthusiasm. Nowhere was this more true than in the broiler industry

The argument reminds me of an episode described by Joan Thirsk in her book Alternative Agriculture: A History: From the Black Death to the Present Day.  The severe labor shortage caused by the black death was, according to Thirsk, a big factor motivating change in the agricultural sector in the 14th century.  

It is amazing how an exogenous shock like plague or war can change perspectives on the relative risk and benefits of new food and farm technologies.