They didn't all head to Israel. Many went to America (my mom & grandma), Argentina, Brazil, Mexico, England, Australia, or anywhere that would have them. A few even stayed put.
These refugees, they survived the Nazis. Their families were decimated, homes, pocessions dispocsessed, lives destroyed. They were stateless reugees. After the war there were quotas to where they could go, sponsors were required to gain entry. Of course these people wanted to go to Palestine (as it was called then), to be amongst their own, to be in a place that allowed them to be themselves without fear.
Previous to WWII, Zionism alreay had a strong foothold in Israel. In 1917, the Balfour Declaration declared a homeland for the Jews in Israel. (Britain was the player as they helped kick out the Ottomans - Lawrence of Arabia...) The UN gave Britain the mandate to establish a national Jewish home in Palestine(with rights to ALL inhabitants). This mandate expired in 1948 (thus the British left), and it all kicked up. In response, the Arab countries kicked out 100,000's of Jews who fled to Israel.
(In 1947 the UN offered a partition between the Jews and Arabs for a two state solution, it was accepted by the Jews, rejected by the Palestinian Arabs and the surrounding Arab nations.)
So, coupling the refugee crisises, and the momentum of the establishment of a Jewish homeland, Palestine was an obvious choice.