The northern portion of the island of Borneo were part of the British Empire as was what is now Malaysia. The larger southern portion was a Dutch possession. Several small kingdoms or sultanates became part of the British Protectorate of North Borneo in 1888. So much of their legal system, educational and civil service worked on the British model much like British Malaya. The Dutch granted independence to Indonesia in 1949 and South Borneo, now Kalimantan, was Indonesian. The British granted independence to Malaya, in 1957 and to North Borneo and Singapore in 1963. They were then all combined as Malaysia. Two years later the Malaysian government voted to separate from Singapore. The sultanate of Brunei, a small part of north Borneo remained a small independent state. Might give a look at "A History of Malaysia" University of Hawai'i Press.
/u/johhny-turbo
Short answer: Northern Borneo was part of the British colonial empire, not the Dutch colonial empire.
Longer answer: They missed out on independence in the heady days of mid-August 1945, and was placed under control of the Allies, who passed it to the British. In 1960 there were attempts to disrupt the formation of Malaya, but this failed. Regime change in Indonesia in 1965 killed the idea.
Pan-Malay nationalism
At the start of the 20th century, there were arguments for a united "greater Indonesia" or "greater Malaysia" that was to comprise today's Indonesia, Malaysia, Singapore, Brunei, etc. Throughout I will use the term "Greater Indonesia", "Greater Malaysia" and "Greater Malaya" interchangeably as the intent is clear. Among others, the idea of a Greater Malaya was promoted by Ibrahim bin Haji Yaacob, a then-British Malaya-based pan-Malay politician who founded the Kesatuan Melayu Muda (KMM) or Young Malays Union in the 1920s-30s, around the time that nationalist movements were starting to form both in the British and Dutch colonies of SE Asia.
Like many other pro-independence, nationalist movements of that time, the KMM promulgated an anti-British view, which attracted the support of Japan and left-leaning groups. So much so that when the Japanese invaded the Malay peninsula in 1941-2, the KMM openly welcomed the Japanese as liberators and collaborated in setting up a Japanese administration.
Japanese occupation
However, similarly to the experience of many nationalist groups in Indonesia such as Sarekat Islam and Sukarno's own Partai Nasional Indonesia, the KMM discovered that the Japanese were in no hurry to grant much independence at all. However, the Japanese significantly re-organized the administration of SE Asia, violating previous partitions due the British and the Dutch: the Japanese placed Sumatra and the Malay peninsula under the 25th Army, Java and Madura under the 16th Army, and Borneo along with eastern parts of Indonesia were under the 2nd South Fleet of the Navy. Borneo was considered a vital area as it provided many key strategic resources to the IJN.
As WW2 went poorly for the Japanese, they started to promise the idea of independence in the future in exchange for collaboration. Given the hard line of the KMM for the independence, they were banned by the Japanese. However, many KMM leaders such as Ibrahim bin Yaacob himself agreed to cooperate with the Japanese, with the idea that it allows the creation of auxiliary volunteer militia units in SE Asia that could be used a nucleus for a nationalist army to guarantee their independence lest the European colonial powers return. The same idea was also sold to Sukarno.
Japan's endgame, and gambit by SE Asian nationalists
As WW2 worsened even further and conditions became very bad due to starvation and shortage of materiel, on one hand there was general dissatisfaction developing into popular enmity against the Japanese occupation. On the other hand, Japanese military administrators became more willing to support independence. The culmination of which was Sukarno's visit with Hisaichi Terauchi, commander of the Southern Expeditionary Army Group, on 12 August 1945, in Vietnam. Terauchi promised independence to Indonesia to be declared in 24 August 1945.
The dates above are important, because by this point conditions for the Japanese were dire, as Terauchi himself was in poor health and he had had to displace his headquarters from Singapore to Vietnam due to Allied invasion of Borneo which had started in May 1945. Mere days after the meeting in Vietnam, the Allied campaign in Borneo had largely succeeded and the Japanese units had surrendered. But there was not yet an Allied invasion of Java, where Sukarno was based.
On his return flight from Vietnam, Sukarno stopped in Perak, Malaya, and met with Ibrahim bin Yaacob, during which Yaacob claimed that Sukarno supported his idea to send a delegation from Malaya to Jakarta to participate in the declaration of independence, the implication being there was to be a Greater Indonesia or Greater Malaya.
Days later on 17 August 1945, Sukarno and Hatta proclaimed the independence of "Indonesia" without specifying what exactly it was, in the very short proclamation avoiding the use of the term Indonesia Raya even if the national anthem uses it as the title. Within days and weeks, Allied units started to land in Java and the battle for the independence of Indonesia had began.
Back in the former British colonies, Ibrahim bin Yaacob and many other nationalist leaders were severely discredited due to their support of the Japanese. As the Allies were able to assert control swiftly, Yaacob flew to Jakarta with his family on 19 August 1945, where he continued to work to advance his view for a Greater Indonesia, taking a new name Iskandar Kamel.
Appeasement toward the US, to enmity toward the US, and finally to friendship with the US
In the 1945-1959 period, Sukarno himself made little reference to Yaacob's claims, nor did Hatta. In fact, in 1945-49 they distanced themselves from Yaacob, as they both followed a policy of appeasement against Communists in SE Asia, who were the only party left at this point who strongly espoused the idea of "Greater Indonesia" or "Greater Malaya". This perceived anti-Communist stance is what convinced the US to pressure the Dutch to allow Indonesian independence, as they feared continuing warfare would only strengthen Communism in SE Asia.
Of course, Sukarno's own politics changed significantly in the 1950s-1960s, in particular his view of the British plans for Malays, which he claimed is a puppet state of the British. This led to Konfrontasi in the early 1960s, an undeclared war between Indonesia and Malaya. By this point Indonesia was getting significant military and economic assistance from the USSR and funneled direct and indirect aid to insurgents in Malaya, with infiltration by irregulars from Indonesia.
However, at this point Sukarno did not use the Indonesia Raya slogan, rather he used the idea of Maphilindo that included not only Indonesia and Malaya, but also the Philippines, whom he was courting as an ally in the confrontation. He also made no direct claim on northern Borneo, for he did not want to be perceived as an expansionist leader. Despite open attacks starting in 1963, the declaration of independence of Malaya which included northern Borneo went ahead.
In 1965, Sukarno himself was deposed and replaced with the pro-US Suharto, and relationship between Indonesia and Malaya was normalized.
Summary and Closing Remarks
The idea of a "Greater Indonesia" (Indonesia Raya) or "Greater Malaysia" was greatly discredited in Malaysia, and in the waning days of WW2 the Allies were able to assert control in key areas of the former British colonies, including Borneo. This all happened in the space of weeks in mid-1945. Thus, northern Borneo remained in British hands until the 50s-60s when the British started to set up independence for Malaya.
Did the Japanese have designs for a Greater Indonesia? This not clear. On one hand, they re-partitioned the territories to suit their own needs, promoted the idea of an eventual independence (within a Greater Asia Co-Prosperity Sphere), and promoted native nationalist movements when it suited them. But on the other hand there is no documentation that they set this as a doctrine. It is telling that even between Sukarno, Hatta, and Yaacob, there were disagreements, contradictions, and lack of clarity.
Later on in the 1960s Indonesia tried to disrupt the formation of an independent Malaya, indirectly arguing that northern Borneo should be part of a Greater Indonesia. This should be viewed in the larger strategic position of Indonesia, what with their insisting on the integration of Dutch West Papua into Indonesia itself. However, regime change in Indonesia killed the idea of a pan-Malaya state.
References
Southeast Asian Culture and Heritage in a Globalising World, by Ooi Giok Ling, Rahil Ismail, Brian B. Shaw.
The Politics of Indonesia-Malaysia Relations: One Kin, Two Nations, by Joseph Chinyong Liow.