That’s easy to answer. First there were always some Jews in land on both sides of the armistice lines of 1948. You can’t retroactively impose boundaries. Second the fact is that after the modern Zionist Movement began in the 1880’s, Jewish agencies purchased the land legally under Ottoman law, again on both sides of subsequent armistice lines.
When the Ottomans were defeated in WWI, the British were given the mandate to rule for the explicit purpose of reestablishing the territory of Palestine as a national homeland for the Jewish people. The mandate was split to give Hashemites the kingdom of TransJordan under British rule. While the whole of Palestine was recognized as Jewish land under the treaties. ending WWI and under the League of Nations, Jordan was never recognized as having any rights west of the Jordan river. That’s why Jordan’s occupation was clearly illegal. By the way, you don’t mention that Jordan never took steps to establish a Palestinian state when it had control of the land.