The two main groups to immigrate during this time were the Irish and British. The Irish bitterly resented the British who ruled Ireland. Many rented from British landlords who treated them as second class sub-citizens. It was densely populated, and suffered from intense economic hardship. Aside from political persecution, the Irish economy depended heavily on the potato crop which was wiped out by potato blight. Because of the long time for potato plants to mature, there was insufficient time for another crop to be planted and many people starved. The Irish Potato famine caused widespread death (over one million) from starvation, promise of the good life in America drew them like flies. They came over crowded in ships that were dangerous and unsanitary. Still,they had no choice, as to stay in Ireland would have been certain starvation.
Many German immigrants tended to be learned people, doctors, lawyers, teachers, etc., who left Germany after the European revolutions of 1848 failed. Attempts had been made to unify Germany but failed. The resultant political persecution caused many Germans to migrate to the U.S. from political necessity.
There were two main causes of immigration from Northern Europe during this time. One was economic and one was political.
The economic reason was the Irish Potato Famine. This famine hit Ireland in 1845 and continued in subsequent years. It caused widespread hunger and starvation and led to hundreds of thousands of Irish leaving to try to make a life in the US.
The political reason were the revolutions of 1848, particularly in Germany. These revolutions were liberal/democratic revolutions that were suppressed by their governments. Revolutionaries and their supporters then had to flee. Many of them came to the US to escape possible political persecution.