In Morocco the Jews were not expelled, in fact Muhammed V was a friend of the Jews and protected them. I personally know that the secretary to the king was Jewish and invited to live in the Palace with their family (relatives of friends). But in Egypt and Libya they were expelled by force, and in many other Arab countries they left because they were persecuted due to 1948 war, and I personally know families this happened to.
First refugees travelling on Hungarian bus arrive at Austrian border (Reuters)
from the article: Peace Plan: Trading settler Israelis for refugee Palestinians