Dex’s summary is somewhat slanted. After WWI, when the Ottoman empire sided with the Germans, it signaled the end of that empire. Britain was given a “Mandate” over what is now Palestine and Israel. After WWII, Britain opted out (after some “persuasion”) and the UN divided the land equally between Israel and Palestine to set up their own states. Palestine did not bother because it figured it would, with other Arab states, drive the Israelis to the Sea, and the attack came the day after the UN resolution. As we know, Israel was not driven to the Sea, primarily because they had veteran fighters from WWII, that fought against the Nazis in resistance movements. I guess, also, because God was on their side. Egypt had air superiority, but with an amazing hold on the southern border by veteran Israel fighters, where one infantry company held off Egyptian forces consisting of 2 infantry battalions, one armored battalion, and one artillery regiment, for five days, Israel was able to purchase much needed aircraft and othe weapons from both Superpowers.
Adding to Dexter’s post, many Russian Jews came over to Israel in the 1920s because of antisemitism after the Revolution. These Jews bought the land, but sometimes the owners were absentee landlords who lived in various other Arabic countries. So, some natives had to leave unvoluntarily.
After the initial attack against the state of Israel (which we, the US recognized right away as a de facto state - and the USSR not to be outdone recognized it as a de jure state), hundreds of thousands of Arabs fled Israel. After the second attack, which came only one month after the Security Council of the UN mandated a truce (and all the parties were too happy to accept - the various Arab countries having been startled at an easy victory that was not), 500,000 more people fled Israel. The PA said they were forced out. Israel said they fled. It is true that Israel asked many to stay, especially in Haifa, so more likely they fled, as not to be attacked again by the Arab countries.