Under British rule Europeans had been restricted in their settlement to the area east of the Appalachians, but after the Revolutionary War this inhibition was removed and so people streamed south and west. Later, with the coming of the railways, markets in the north could be served from further west. This allowed the great expansion of cities such as New York and Chicago.
see more:which was a factor that led to the scientific revolution
In the years immediately before the American Civil War in the 1860s the railways had built up into quite a network serving the eastern states, but afterwards they gradually spread over the rest of the country. This meant that people no longer had to spend many weeks of hardship in order to reach their destination and so the tiny townships already established by earlier settlers were quickly expanded new comers seeking for themselves and their families a better life.
The Irish potato famine of the 1840s as described on the History Place web page, The Blight Begins led to many immigrants from that country, the majority would not have been city folk, so it is perhaps natural that some migrated to the western states where they saw at least some hope for their future, just like all the other migrants.