This appears to be summed up from the Wikipdia articles West Bank Legal Status, Israel 1967 Occupied Territories, and Israeli Occupation of Palestine, but I will organize and summarize:
From 1517 to 1917 the West Bank was part of the Ottoman Empire. Turkey, successor state to the Ottoman Empire, renounced its territorial claims in 1923, signing the Treaty of Lausanne, and the area now called the West Bank became an integral part of the British Mandate for Palestine. During the Mandate period Britain had no right of sovereignty, which was held by the people under the mandate. Nevertheless, Britain, as custodians of the land, implemented the land tenure laws in Palestine, which it had inherited from the Ottoman Turks (as defined in the Ottoman Land Code of 1858), applying these laws to both Arab and Jewish legal tenants or otherwise. In 1947 the UN General Assembly recommended that the area that became the West Bank become part of a future Arab state, but this proposal was opposed by the Arab states at the time. In 1948, Jordan occupied the West Bank...
The crux is, as of 13 May 1948, Britain was custodian of the Palestine region (there was no "Palestine" conutry yet), and the people had sovereignty, so no state had sovereignty over the area. When the British Mandate ("Mandatory Palestine") was in process, United Nations Partition Plan for Palestine was planned to establish Israel, a new country called "Palestine", and a "Special International Regime for the city of Jerusalem". The "Jewish Agency for Palestine" reluctantly agreed, but the "Arab Higher Committee", the "Arab League" and other Arab leaders and governments rejected it, because most of the land (~57%) was being given to to Israel, despite the fact that there were far more Arabs (725,000 ) than Jews (407,000), and the Arabs had been living there for literally thousands of years, while the Jews had literally just showed up. Eventually, the British gave up and left.
The British Mandate ("Mandatory Palestine") ended in 1948, at which point Israel founded itself, claiming (most?) lands from the UN partition plan, and a military coalition of Arab states immediately moved their militaries in to the West Bank (Mostly Jordan), and attacked Israel, but did not claim sovereignty.
In 1949, Israel signed peace treaties ending that war, with Transjordan's military occupying the West Bank. Note that at this point, no state has claimed sovereignty.
April 24, 1950, Jodan declared sovereignty, but "On 12 June 1950, the Arab League declared the annexation was a temporary, practical measure and that Jordan was holding the territory as a "trustee" pending a future settlement." Britain and the USA recognized Jordans claim, but Israel did not. This dispute is the source of the later disputes.
In 1956, Egypt cut off some of Israel's Ocean trade passages, and this escalated into The six day war, at the end of which, Israel's military now occupied the West Bank. Israel then moved in many Jewish families to found new settlements in the area.
This is where we get to the crux of your question:
- According to countries that accepted Jordan's annexation, this territory is "Occupied Territory", and therefore these settlements are a violation of the Fourth Geneva Convention, Part 3, Article 49 which contains
The Occupying Power shall not deport or transfer parts of its own civilian population into the territory it occupies.
- According to countries that do not accept Jordan's annexation (which is basically just Israel), this is "Disputed Territory", because no border was ever formally agreed upon, and no state had accepted sovereignty over the area.
In 1988, Jordan renounced claims to and severed administrative ties and sovereignty with the territory in 1988, to the Palestine Liberation Organization, and establish the country of "Palestine" for the first time. But since Israel never acknoledged Jordan's ownership in the first place, they also never acknowledged Palestine's existence, and therefore never acknowledged Palestine's sovereignty. Israel's stance was that this land still had no state ownership.
But then things got even more confusing! In 1993, Israel and Palestine Liberation Organization signed The Oslo accords for Israel to remove their military, for the PLO to take over ownership, that Israel would formally recognize "Palestine" as a new country, and that they had 5 years to work out the details of a peace plan. Israel claims that, even if the settlements were hypothetically illegal in the first place, the settlements have now been handed over to the PLO, and therefore the problem has already been solved. International courts disagree, upon observing that Israel never actually withdrew their military, so therefore the region is still under military occupation.