I can’t say which sultanate was the most powerful or exactly how rich they were, but I can shed a little bit of light on why there were so many of them and what it meant to be a rich and powerful sultanate.
I assume the massacre you refer to is during Indonesia’s struggle for independence after WW2, when several sultans were overthrown or killed, especially in Sumatra. However, there were still many sultans who survived with their sultanates intact, whose domains were incorporated into the Republic of Indonesia in the 1940s and 50s and whose descendents are around today.
Now the big disclaimer: This question is extremely difficult to answer because when we talk about “Indonesia”, we are talking about an enormous and diverse country, and what was true in one part of what we now call Indonesia may not have been true in another. On the island of Sumatra alone there were enormous differences between the polities on Sumatra’s eastern coast bordering the Straits of Malacca, those on its western coast, and those in its mountainous interior. Matters are further complicated by the fact that polities in parts of Indonesia might have had more in common with what are today different countries, than with another part of Indonesia. The Aceh Sultanate in the north of Sumatra, for example, existed very much as part of the world of the Johor Sultanate and Portuguese-controlled Malacca, both of which are part of present-day Malaysia. There was a lot more interaction between these three powers than the interaction the Aceh Sultanate had with the Moluccas-based Sultanates of Ternate and Tidore, even though those two are also part of present-day Indonesia.
Part of this diversity means that I’m going to assume that the question is about “principalities” or “polities” rather than the title of “sultan” specifically, as sultans were hardly the only leaders in Indonesia. There were rajas, who were the equivalent in Hindu kingdoms, and the Susuhunan, who were the equivalent in Mataram (and also in one of its successor states, Surakarta). There were traditional rulers who thought of themselves as kings, even though they commanded a relatively small number of people, and the way they exerted power might not have conformed to our idea of what a king should be.
Sometimes a ruler’s title might, on paper, be of lower standing, even though he ruled over a powerful polity. Surabaya, for example, was the leading power in east Java from at least the beginning of the 17th century, yet it was ruled by an “adipati”, roughly translated as a duke. Conversely, there were sultans with little to no power - the Sultanate of Ternate was annexed by the Dutch in 1914, yet from 1929 to 2019 there were still Ternate sultans being formally recognised. As recently as 2018, Indonesian President Joko Widodo invited the country’s kings and sultans to meet. Only the sultan of Yogyakarta has held any formal power for at least the past 60 years, yet about 90 kings and sultans turned up. Some of them weren’t even “full time” kings, they held day jobs and served their communities on weekends.
I will describe 3 reasons Indonesia was able to support so many polities:
2 reasons Indonesian polities tended to multiply in number:
And 2 reasons for the preservation of many polities:
I can’t stress enough how complex Indonesia as a country is. My answer barely scratches the surface, will be full of generalisations and oversimplifications and will focus mainly on "Malay World" polities from the 1600s onwards.