The Jewish People have lived in Jerusalem continuously since *at least* 1000 BCE, when King David made it the capital of the Kingdom of Israel (the United Monarchy).
The first settlements in what is now Jerusalem can be dated to 4500 BCE, and its original name, in Western Semitic (the precursor to languages such as Hebrew), was Ursalim.
There are two main theories as to why Jerusalem is named Jerusalem (Yerushalayim in Hebrew): (1) it means “City of Peace” in Hebrew, and (2) the original name, “Ursalim,” was an ode to the ancient Canaanite god Shalim, or “the god of dusk” (a reminder that Hebrew is the only Canaanite language that has survived to this day; in other words, whatever the true meaning of the word “Jerusalem,” it was a word coined by the ancient ancestors of the Jews, the Hebrews).
In November of 1947, following the Holocaust, World War II, and the Arab riots of the 1920s and 1930s, the United Nations voted in favor of partitioning what was then known as the British Mandate for Palestine into two states, a Jewish and an Arab state, as well as the implementation of a “Special International Regime” for the city of Jerusalem. The Jews accepted the plan, but the Arabs rejected it. The very next day after the vote, Arab mobs began attacking Jews near the Jaffa Gate of the Old City of Jerusalem, Arab gunmen ambushed two Jewish buses near Petah Tikva (killing 7), and Arab snipers shot at buses and pedestrians in Haifa, Jerusalem, and Tel Aviv; as such, a civil war broke out.
1948 ARAB-ISRAELI WAR
In accordance to the United Nations Plan for the Partition of Palestine and the end of the British Mandate, Israel declared its independence on May 14, 1948. The morning of May 15, a military coalition that included Egypt, Transjordan (Jordan), Iraq, Syria, Lebanon, Saudi Arabia, and Yemen invaded the newly established nation, with the open aim of obliterating the Jewish state and, quite literally, “driving the Jews into the sea.”
For example, in 1955, the Iraqi representative to the United Nations stated: “The highest official in the League said that with 300 soldiers or North African Volunteers we could throw the Jews into the sea. The  war started and His Excellency then said that with 3,000 North African Volunteers we could throw them into the sea.” Hassan al-Banna, founder of the Muslim Brotherhood, also stated in 1948: “If the Jewish state becomes a fact, and this is realized by the Arab peoples, they will drive the Jews who live in their midst into the sea.”
A reminder that this these genocidal threats were made just 3 years after the Holocaust. In September of 1948, the Palestinian Arab “Army of the Holy War” entered the Arab coalition of states attacking Israel. Many of its fighters had been trained by the Nazi SS during World War II.
The fiercest battle during the 1947-1949 war is known as the Battle for Jerusalem, which took place between December of 1947 and July of 1948.
SEIGE OF JERUSALEM
On May 28, 1948, just 13 days after the Arab invasion, the Jews of Jerusalem, with only about 200 fighters remaining, surrendered. There were 100,000 Jews living in Jerusalem at the time. The Arabs (aided by British officers stationed in Jordan) then used the opportunity to besiege the city, cutting off the only road that connected it to the outside world, effectively enacting a blockade.
Arab military leaders stated that their goal was to isolate the Jewish civilians in Jerusalem from the Arab civilians, and that they would do so by “strangling” the city. 1300 Jews, including the elderly, women, and children were put into captivity. Men — including very elderly religious men — were put into POW camps in Jordan. About 600 Jewish civilians were killed.
With 100,000 Jerusalem Jews cut off from the outside world, the Jews were left with no resources. This led to a shortage of everything: weapons, fuel, food, and even water. In fact, water was rationed. Survivors recalled standing for hours in enormous lines just to get the limited amount of water allocated to each person, “one pail of water,” which had to be used for everything: drinking, cooking, bathing, etc. There are written accounts from the period describing the dead simply lying on the streets.
By June, the weekly ration per person was 100 grams of wheat, 100 grams of beans, 40 grams of cheese, 100 grams of coffee or 100 grams of powdered milk, 160 grams of bread per day, 50 grams of margarine, and one or two eggs for those that were ill.
The water shortage was so severe that people fought over water. It’s estimated that (tw: weight), on average, people lost about 5kg per person during the siege.
Throughout the siege, the Arab legion (led by local Palestinian Arabs), which had control of the important vantage points surrounding the city, repeatedly destroyed all relief trucks (food, water, etc) that attempted to reach Jerusalem.
Throughout the length of the siege, the Haganah, the Jewish paramilitary organization that preceded the IDF, repeatedly tried to cut through the blockade to rescue the city’s Jews, but their attempts were unsuccessful.
Fed up with the increasingly desperate situation, the Haganah launched Operation Nachshon in April of 1948, with the objective of reaching Jerusalem and cutting through the siege. To do so, they worked on gaining access to the villages that surrounded the city, which the Palestinian Arab fighters used as vantage points to destroy relief trucks. One of these villages was Deir Yassin, where the more radical militias (or, according to some, terrorist groups) of the Lehi and Irgun massacred around 107 Arabs (the number is disputed). Many consider the Deir Yassin massacre the main catalyst that prompted Palestinian Arab refugees to flee in 1948.
Between April 15-20, three convoys were able to reach Jerusalem, but the Arabs blocked the road again immediately. Various other Haganah operations took place in the aftermath.
In 1949, the Armistice Agreements left Jerusalem divided between Israel (West Jerusalem) and Jordan (East Jerusalem, including the Old City). In 1950, Jordan annexed East Jerusalem, in a move that the international community considered illegal.
EXPULSION OF JEWS
40,000 Jews — the entire remaining Jewish population* of East Jerusalem and Judea and Samaria (the West Bank) — were forcibly displaced (i.e. ethnically cleansed) by the Jordanians following the (internationally illegal) Jordanian occupation of East Jerusalem and the West Bank. Not even the Arab League recognized the Jordanian annexation in 1950: only Great Britain and Pakistan did.
*”remaining” because 1 in 10 Jews in Jerusalem were killed during this period
Even the Jordanians themselves boasted, “For the first time in 1000 years not a single Jew remains in the Jewish Quarter. Not a single building remains intact. This makes the Jews' return here impossible.”
According to the armistice agreement, Jordan was supposed to allow access to Jews to holy sites and cultural institutions. Jordan, however, did not abide by the agreement. Instead, it destroyed the Jewish Quarter, including 58 synagogues, and desecrated thousands of Jewish tombstones at the Mount of Olives. Many Jewish holy sites were desecrated and even turned into chicken coops and horse stables. The Western Wall (Kotel), the holiest place Jews are currently allowed to access, became a slum area.
Until 1967, when Israel captured (or reunited) East Jerusalem during the Six Day War, East and West Jerusalem were separated with barbed wire. Often, children on both sides of the fence would play soccer with each other. However, Jordanian snipers would sometimes shoot at Jewish kids at random.
For a full bibliography of my sources, please head over to my Patreon.