Cultural differences between rural and urban, coastal and oasis communities (as well as along other parameters) differentiate Jewish groups from one another. Jews living in rural areas share many characteristics with Jews from other rural areas, as do Jews from different cities or those who reside along different trade routes.
Certain ritual differences can be understood in terms of regional differences. The differences between the "native" residents of a particular city and new immigrants are sometimes marked by the continued use of certain rituals by one group or the other. For example, during the Middle Ages the Rabbinites in Cairo were divided by use of either an Iraqi synagogue, later frequented by Jews from Spain, or use of the Palestinian synagogue, which was also used by North African sojourners and immigrants. Similarity, Jewish families in Aleppo, Syria, know if they are of Sephardic origin or of Mustarib origin.
The distinction between Sephardim and Ashkenazim is similar. The groups each recognize the other as legitimately Jewish, while noting cultural differences resulting from the disparate locations of the original groups. The Sephardim had lived on the Iberian Peninsula, which medieval Jews called "Sephard," whereas Ashkenazim had lived in Germany, called "Ashkenaz" in medieval times. The differences between the two groups came to involve liturgical matters, language (both the domestic language and the pronunciation of Hebrew), and the interpretation of laws. For example, the order of prayers in the prayerbooks varied slightly; Ashkenazim, but not Sepahardim, generally prohibited polygynous marriage and the levirate; and the Passover diet was more restricted for the Ashkenazim than for most Sephardim.
Because of the dissemination of Sephardic publications, most Jews in the Middle East came to use the Sephardic prayer book and to follow the Sephardic interpretation of the laws, contained in Joseph Karo's Shulhan Arukh. Thus, these Jews have often been classified as Sephardim, whether or not their ancestors actually lived in Spain.