If you stayed on the land you had to work, not quite like a slave, but close. And if you disagreed with this, the government had an army that convinced you ...
Factories offered a better alternative than that, and yes, mostly because the agricultural option was just not open, and just not worth it. They also offered a great density of people that made the labor movement possible in the first place.