How did the cult of personality evolve in North Korea? Quickly in some ways, slowly in others, and perhaps not at all in some. We don't actually know the degree to which the average North Korean uncritically swallows the Kim regime's propaganda.
But let's start with the basics!
What are North Koreans asked to believe? North Koreans are reared from birth to honor Kim il-Sung, the once-leader and now "Eternal President" of their nation. He is the greatest military hero of the Korean people, having single-handedly saved Korea from the ravages of the Japanese empire. He was also an artistic genius, having penned several operas that are performed to this day. His generosity of spirit and smiling benevolence were second to none; he was the reason that North Koreans had food, clothing, toys, jobs, and homes. He held the nation together and successfully defended it against the wolflike Americans. When he visited factories and workplaces, prosperity flowered in the wake of his impeccable advice. His son Kim Jong-il, while undoubtedly a lesser light, showed the power and strength of the bloodline! At his birth on the sacred Mount Paektu, soldiers carved prophecies of his eventual greatness onto the nearby trees. He fired at retreating Japanese soldiers at the age of three. Kim Jong-il would go on to become one of the world's greatest film directors and critics, a peerless minister to the people, and tender shepherd of the nation through its Arduous March, which he and his father totally didn't cause. Portraits of the Kims are to be hung and cared for in each home and workplace as a reminder of the family's guardianship of the Korean people. Bonus points to anyone who dies protecting one! Pins of one or both Kim il-Sung and Kim Jong-il are to be worn for the same reason.
And so on, and so on ... there's actually quite a lot more that could be written about this. We've barely scratched the surface.
To be clear, personality cults are nothing new. They date to the earliest forms of complex human government and were an inescapable part of absolute monarchies. Even in modern democracies, successful politicians get some mileage out of very mild forms of it. (Though I'm sure some stick-in-the-mud historians who are just no goddamn fun would disagree that the cultural impulse behind the god-kingship of the pharaohs ≠ Obama-Biden memes.) However, personality cults evolved and enjoyed a renaissance during the 20th century, particularly in Soviet-aligned states, and the Kims were far from being the only beneficiaries. What was unique about the North Korean version was its incredible strength and longevity. It's so grotesque and laughable to outsiders that it's inevitably one of the features that attracts Western attention to NK.
However, historians have a pretty decent handle on how and why it developed the way it did:
However, if I had to pick any one element as the most influential -- or at least, the one in which the personality cult started to assume the bugfuck crazy form in which it exists today -- it'd be the power struggle over succession in the mid-1960s to mid-1970s.
This is a very complicated subject to discuss, but to simplify, we'll start back at the end of WW2.
Since 1910, the Korean peninsula had been under Japan's imperial rule, but when Japan surrendered to the Allies, they left Korea, and this is when it all began.
The Soviet Union and America entered the Cold War, and each sought power wherever they could in the world. When Korea finally regained its independence, the Soviets and Americans saw an opportunity to gain a piece of allied territory.
Each wanted Korea in their image, but instead of starting a full-scale conflict over it, they decided to split the country (arbitrarily) at the 38th parallel.
The Soviets wanted a communist regime, so they wanted a leader they had some sway over. They needed whoever they chose as leader to be popular among Koreans but also trustworthy and loyal to the Soviets. Kim Il-sung, a guerilla leader who fought for the Soviets in WW2, fit the bill, and installing him was surprisingly easy because he was seen as a Korean patriot worthy of respect among the people.
At this point, we'll zoom out briefly to explain the larger dynamic. All you really need to know is that the Soviets were apparently better backers than the Americans, and for a time, it looked as though NK would win the entire peninsula.
America was unhappy with this, and they got the UN involved to help push the North Koreans back. But instead of leaving it at that, they proceeded to bomb the hell out of North Korea. (Estimates suggest American bombs are responsible for killing 20% of NK's population at the time.)
China eventually stepped in (because the fighting was getting too close to the NK-China border) and helped NK fight the Americans back to the 38th parallel. This is where the war has been since 1953.
So now we get back to NK. The destruction wrought by America had devastated the country. North Koreans hated and feared America, and Il-sung used this to his advantage. He created a narrative where the American threat was ever-present—unless the people allowed him absolute control.
Il-sung devoted his country and its resources to preparing for another attack by America, and for the next few decades, this is how the country operated. The country became more militarized, and they started as a nuclear power, all while controlling all aspects of civilian life, from food to wares to information.
Il-sung knew how to control people by playing on their fears and their dreams. He used these fears and dreams to justify everything he did. But to ensure that people could go along with his totalitarian rule, there needed to be a massive propaganda campaign calling for unflinching support of Il-sung. Through the years, the campaign became more aggressive. There was a true love of Il-sung among the people, but it's hard to know how far that loves goes and how much is political and social pressure to keep up your appearances of praise for Il-sung.
So in the end, Il-sung was a trusted patriot who saw the country through the horrible war against America, and seemed to devote the rest of his life and his country's resources to defending his people from another American attack. This was all concomitant with the propaganda campaign that gushed over how incredible and competent he was, all part of the plan to ensure he could do whatever he wanted with the country.
And this is the end of Il-sung's story. He died in 1994, at which point his son came to power. But his son also came into power under difficult circumstances: the Soviet Union had collapsed three years earlier. Without any Soviet aid, things were starting to fall apart in NK, which was in stark contrast to the flourishing country to the south.
So Kim Jong-il made a drastic play. Since his country looked bad on the inside, he decided the rest of the world must be made to look bad as well. This was done by stifling all information from the outside world, an extension and expansion on what his father had done.
Now at this point, Jong-il was the head of a failing communist state that was telling its people they were the luckiest and most well-off people in the world, and this lie got out of hand. They even have a popular NK song, which translates to, "We have nothing to envy in the world." For a long time, few people knew anything about how the rest of the world was doing.
The only real choice was to dial up the propaganda to 11, and a lot of what is said about Il-sung now actually came after his death where he was further idolized by his son and the government. The best response to keeping their government intact despite the desperate living conditions of their people was to constantly push how special and powerful their leaders were while also suppressing outside information on the prosperity of the rest of the world.
Jong-un did nothing more than repeat this behaviour, and at some point, the propaganda machine deemed them the "divine beings" we know today. The evolution was, oddly enough, arguably the only thing they could have done if they wanted to keep their power without changing their entire country's ethos.
Tl;dr: public fears of American attacks were used to justify and fuel a propaganda machine that illustrated the power, competency, and divinity of the Kim family as the country fell into increasingly difficult times.