Here is an example from the latest UN Commission of Inquiry report. It finds that Israel's "occupation" is unlawful under international law. It says:
The occupation of territory in wartime is, under international humanitarian law, a temporary situation, which deprives the occupied Power of neither its statehood nor its sovereignty. Occupation as a result of war cannot imply any right whatsoever to dispose of territory.
The footnote to this points to the International Committee of the Red Cross (ICRC), commentary of 1958 on article 47 of the Convention relative to the Protection of Civilian Persons in Time of War.
The wording of that commentary makes it clear that Israel is not occupying "Palestinian territory" which is the linchpin of the entire argument.
It says:
This provision of the Hague Regulations is not applicable only to the inhabitants of the occupied territory; it also protects the separate existence of the State, its institutions and its laws. ...As was emphasized in the commentary on Article 4, the occupation of territory in wartime is essentially a temporary, de facto situation, which deprives the occupied Power of neither its statehood nor its sovereignty.
What state is Israel occupying? If there was no state there, there is no occupation. The UN report's own footnote betrays that the assumptions behind the entire report itself is false.
The commentary emphasizes that the purpose of the Convention is to protect the people, not the State. Israel agrees with this and its High Court rulings have always upheld the humanitarian aspects of the Geneva Conventions even without the existence of a Palestinian state in the territories it controls.
However, the text itself makes it clear that there is no occupation if there is no previously existing State that had legal title to the land - and there wasn't one. It sure isn't Jordan, whose annexation of the West Bank was illegal by virtually every yardstick. It cannot be the "State of Palestine" because we are told - by the UN - that the territories have been occupied since 1967 and no one claims that the "State of Palestine" existed before 1988 at the earliest.
I have yet to find an international law expert say the exact date that "occupied territories" of 1967 became "occupied Palestinian territories." But the UN retroactively says that the territories that Israel won in a defensive war have been "Palestinian" since 1967 - they even have had a "Special Rapporteur on the situation of human rights in the Palestinian territories occupied since 1967."
Israel also has the absolute right to protect its own soldiers and citizens from harm that comes from the territories, under the same Geneva Conventions. As always at the UN and with other modern antisemites, a question of competing rights is being treated as if only one side has human rights, and they assume that Jews simply do not have such rights.
The UN's fast and loose definition of "occupation" is made clear in footnote 10:
For the purposes of the present report, “the territories that Israel occupies” and equivalent terms are a reference to East Jerusalem, the Syrian Golan, Gaza and the West Bank outside East Jerusalem.
Israel doesn't occupy Gaza by any definition of the term that existed in any legal manual or article before Israel's withdrawal from the territory in 2005. Those who claim that Israel occupies Gaza without having a single soldier there have literally made up a new definition of occupation to apply to Israel only. Essentially, the UN is admitting - not for the first time - that it doesn't care about the legal definition of occupation to begin with; it applies the label to Israel without any regard to what it means.
Which is this entire report in a nutshell. If Israel is not occupying "Palestinian territory" under the legal definition of occupation then there is no "occupation" that can be declared illegal. The UN decided to make the declaration of illegality first, and tried to justify it afterwards, all while pretending to give an impartial legal analysis.