In 1948, the Nazi collaborating Mufti of Jerusalem worked with Egypt to create the "All Palestine Government" in Gaza. Transjordan;'s King Abdullah was against this, saying that he represented the Palestinians. And the Arab world split between the two sides.
From the Palestine Post, September 22, 1948:
Countering Abdullah's protests. the Mufti and his family declared statehood from Gaza a week later:
Formal notice of the formation of an independent Arab state “for all of Palestine” was given today to the United Nations in a cable from Cairo signed by Ahmed Hilmi Pasha, premier of the newly-established Palestine Government, which has its seat at Gaza. The cable reads:“The Arabs of Palestine, who are the owners of the country and its indigenous inhabitants, and who constitute the great majority of its legal population, havesolemnly resolved to declare Palestine in its entirety and within its boundaries as established before the termination of the British Mandate an independent state, and constituted a government under the name of the All-Palestine Government, deriving its authority from a representative Council based on democratic principles and aiming to safeguard the rights of minorities and foreigners, protect the Holy Places, and guarantee freedom of worship to all communities.”
The "Palestine" they declared included all of Israel.
Most of the Arab League ended up recognizing this All Palestine Government, except for Transjordan. No other nation did. But despite this supposed recognition, everyone knew it was a puppet government - it wasn't involved in the armistice negotiations between Egypt and Israel that included drawing Gaza's borders, and it was not involved in aiding its own refugees nor in negotiating with UNRWA. Egypt was the ruler of Gaza in every real sense and everyone know it.
Later, Transjordan annexed the West Bank. Because no Arab leader really wanted a Palestinian state.
The connection between Gaza and the West Bank was always somewhat artificial. It was just as clear in 1948 as it has been in recent years.