It was a British port for a long time (one of many parts of the Straits settlements). When Malaysia won independence, it included Singapore.
Lots of friction between Malay Chinese and Malay. The British colonizers left but the wealthy Chinese remained (similar trend seen in many SE Asia countries).
Singapore was kicked out of the Malay Federation not long after independence. Most simplified it was a power struggle in who would run Malaysia. Easier to cleave Singapore off as the heavily Chinese population wielded a lot a power.
But don’t get me wrong. Singapore has accomplished a lot. A tiny population be forced to go out on its own is not an easy hand to be dealt. To me, Singapore’s approach has been mostly just practical. They don’t care if public housing is “socialist” or if a single government approved union is authoritarian. They do what feel will yield the outcome they need.
But I get the sense they still have a very “survival” mentality - what they have is fragile and without close management will fall apart. Likely very true 50 years ago, but not so much today. But the governing party is the same and the mentality remains - one bad decision and as LYK says “Singapore dies”.