The end of the British Mandate for Palestine in 1948 was influenced by several factors:
International Pressure and United Nations Involvement: After World War II, the global community, particularly the United States, pressed Britain to find a solution to the increasing conflict in Palestine. The UN was asked to take over, which led to the proposal to partition Palestine into separate Jewish and Arab states.
Jewish Immigration and Conflict: Jewish immigration increased significantly after the Holocaust, leading to tensions and conflict with the Arab population. Britain's inability to manage this conflict contributed to their decision to withdraw.
Economic and Military Strain: Maintaining control over Palestine was becoming increasingly costly for Britain both financially and militarily, especially in the aftermath of World War II.
Cold War Considerations: Britain needed to focus its resources and attention elsewhere, particularly in response to growing Cold War tensions. The strategic importance of the Middle East was recognized, but Britain decided it could not afford to maintain its presence in Palestine.
Local Resistance and Violence: Both Jewish and Arab groups carried out attacks against British authority, seeking to achieve their own aims, which made British governance untenable.
Political Failures: Repeated attempts to broker a peace between Jewish and Arab inhabitants failed, showing the limits of British diplomatic influence.
For detailed accounts, you can view sources like this article from Wikipedia and an analysis on Academia.