Funeral seeks to unite N Korea
The handing on of power from an old dictator to a new one can be a moment of great tension, especially if the new one is under 30 and has no political or administrative experience of any kind.
Hence the need to provide the people of North Korea with a certain reassurance.
The elaborate choreography of the funeral parade and the emotional crowd-scenes as Kim Jong-il's coffin was driven round the centre of Pyongyang were intended to unite the country in grief, and make the change of power more secure.
It was also intended to emphasise that Kim Jong-un is the latest member of the family firm established by his grandfather, Kim Il-sung. His strongest point is who he is, not what he has done.
Many people in the crowd will have taken comfort from it, just as the North Korean authorities wanted.
Many people in the noisily mourning crowds were quite well dressed by North Korean standards. They also looked reasonably well fed.
A recent defector who escaped from North Korea to the South told the BBC he thought such people might well feel a twinge of sadness over Kim Jong-il's death, because they had done comparatively well during his 17 years in power.
But he had spoken by phone to several people in the countryside, who told him openly that they hated Kim Jong-il for the devastating poverty they had suffered as a result of his policies.
Travellers who have succeeding in getting beyond the poor but more or less adequate suburbs of Pyongyang often tell stories of hungry, gaunt country-dwellers. Such people have no reason to give any support to the regime.
Even so, in a country where the labour-camps are overflowing with prisoners, it is dangerous to show signs of resentment.
As Kim Jong-il's funeral cortege passed through the streets, anyone in the large crowds who did not seem to be sorry would have been asking for trouble.
You could sometimes see clearly that people were waiting for their cue to start weeping.
And twice at least the live television coverage accidentally showed policemen or other officials holding up cameras to get shots of the crowd standing close to them. It seems unlikely they were simply getting mementos of the occasion.'Caring leader'
The young Kim Jong-un will have the backing and guidance of his uncle, Chang Song-taek, a senior figure in the leadership who is married to Kim Jong-il's sister, Kim Kyung-hee - a general in her own right.
Will the new team try to keep the lid on North Korea as firmly as his father did? It is much too early to tell, of course, but it is a historical truism that a dictatorship is at its most vulnerable when it tries to ease up.
Yet if North Korea maintains its ferocious grip on the lives of its citizens, there is always the possibility that they will finally be pushed too far.
People who visited Nicolae Ceausescu's Romania as late as the summer of 1989 believed that the ferocity of his rule had wiped out the very instinct for personal freedom among ordinary people. But by late December that year they had risen up, and he and his equally tough wife had been executed.
It is a great deal easier to set up a dictatorship than to change the way it operates.
Kim Jong-il, having inherited the autocracy from his father, Kim Il-sung, kept it going intact under some pretty terrible conditions. But can Kim Jong-un repeat the trick, in a world which suddenly has several fewer dictatorships?
His public relations team is already trying to build him up as a caring leader. The North Korean press is running stories that he has sent out hot drinks to mourners in the streets.Chinese concern
China, North Korea's giant neighbour and virtually its only friend, will have an important say in the way the new regime in North Korea develops.
During his lifetime Kim Jong-il was sometimes an embarrassment to the Chinese leadership. The Chinese understand the importance of peace in Asia; he, after 2008, seemed determined to pick a fight with South Korea.
China's leaders hate being isolated, and though they are closely linked with more than one rogue state, they prefer to look good in the eyes of the world.
If Kim Jong-un and his team were to try settling themselves on power by threatening South Korea, perhaps with nuclear weapons, China would be intensely angry. Still, it might prove hard to stop them.
China is trying to perform its own balancing act between liberalisation and keeping the lid on protests. It is not proving easy.
And the way North Korea develops may well have an effect on China's future, too.