The independence struggle of Indonesia was long and protracted for when Japan surrendered, in August 1945 the Netherlands - just liberated itself - was in no shape to reclaim authority over Indonesia and the nationalists claimed independence. They had collaborated with the Japanese, who had instituted an army. They managed to establish de facto control over parts of the huge archipelago, particularly in Java and Sumatra. In many parts, however, chaos reigned.
Initially the United Kingdom sent in troops to take over from the Japanese and they soon found themselves in conflict with the fledgling Republic. Then the Netherlands were asked to take back control. Initially the Netherlands negotiated with the Republic and came to an agreement at Linggajati. A major point of concern for the Netherlands was that all Dutch in Indonesia had been put in rather awful concentration camps by the Japanese. The Indonesians were not very cooperative in liberating these people.
Soon the agreement was violated on an ever greater scale in a way reminiscent of what would happen to the Oslo peace accords between Israel and the Palestinians several years later. The hawkish forces won out on both sides and eventually the Netherlands mounted the biggest military effort in its history to conquer back what it believed was its territory. The two wars that followed were therefore considered mere 'police actions'
There were atrocities and violations of human rights in many forms. Although the Netherlands managed to conquer all of the Republic and put Sukarno (its President) back in jail, this marked the end for Dutch colonialism. The rest of the world, notably the United States of America had had enough. The Netherlands were forced to negotiate and at the Round Table conference in The Hague in 1949, the country finally threw in the towel, thereby ending the most shameful episode of its history.
There were interesting reasons behind Dutch (and Indonesian) tenacity: Both sides believed that the Indies were Holland's "life-blood". Consequently, if the colonial ties were severed, the Netherlands would remain as desperately impoverished as it had emerged from the nazi occupation. Conversely, the Indonesian side was convinced that independence would lead to more or less immediate prosperity. The bitter irony is that the opposite actually happened: by 1960 the Netherlands were prosperous and Indonesia in very dire shape.
Economically, the life-blood theory was faulty on two counts: It did not recognize that open borders in Europe were far more important to the Dutch economy than the colonial empire. On the Indonesian side it was not recognized that the Dutch were not just takers but also bringers. When the last Dutch were expelled from Indonesia in 1958, and their businesses taken, the Indonesian economy took a nose dive, because it caused an exodus of much needed expertise which could have been used to help the country.