In general, I recommend people interested in the topic of pig farming check out this book by Horwitz. Among other things, he discusses, in a non-judgmental way, how efficient, well-capitalized integrators reorganized the hog industry in America.
The Mangalitsa was the "factory pig" of the Balkans in the 19th century. As described here, once the Hungarians drained the swamps, they put the pigs on farms and fed them the surplus corn they grew.
Rather than wanting wild-boar-like breeds that could forage and survive in rough natural conditions, they wanted pigs that would get really fat on their new farms, to meet the needs of consumers with rising incomes who wanted lots of fat. Compared to running hogs in the swamps and forests, the hogs farms of the 1800s represented an unprecedented level of hog confinement.
It is interesting that the Mangalitsa exists in its current form because in 1833, Hungarians purposefully bred an extreme lard-type hog for their "factory farms". It is raised in fairly similar circumstances now - circumstances that almost 200 years later look quaint compared to the state-of-the-art farms used to raise Iberico in Spain.
Old-school free-range pig herder with pre-Mangalitsa pigs
When the Hungarians made the transition to putting pigs on farms, the people who made their living running pigs the old way were driven out of business. Some of them likely found employment mucking out the stalls on the new "factory farms", or cooking up porridge for Mangalitsas (in an age before grinders). How tedious and boring the new work must have seemed, compared to the excitement of working with nasty half-wild pigs.
Then, as now, the farmers using the newest technology could argue that their animals suffered less morbidity while efficiently meeting the needs of consumers.