First, North Korea is punished for its wrongdoings even more than ever and becomes a still more isolated and closed country than it ever had been. Nobody comes in, and nobody comes out. Even China cutted off all relations. Even peace negotiations with South Korea are ended for once and all (they never produced anything meaningful anyway). People caught trying to come in are promptly shot on sight. People who are able to leave won't ever be allowed to come back. North Korea's government works very hard to ensure this draconian policy and they become very effective in doing that.
Meanwhile, some fundamentalist cult guys engage into bioterrorism. They are very scientifically skilled, very well-financed, very secretive, very well-organized and very motivated by fanatism. Their ultimate purpose is to sterilize all the humanity leading to its extinction.
The bioterrorist group develop many different kind of very efficient viruses for reaching their purpose. Those are the characteristics of those viruses:
Act by reducing otherwise healthy women fertility to near zero by inducing miscarriages and severe birth defects in human fetuses or perhaps by just messing up with ovule production. Screwing up with male's sperm is also a target.
Spread out sexually.
Spread out by air from person to person like common flu.
People carrying those viruses will seems to be healthy and asymptomatic, otherwise normal people, so they may live and spread out the viruses unaware of the fact for many years.
Those virus were engineered with the purpose of evading clinical tests and detection. They also do not develop or even self-destructs in lab conditions with the purpose of slowing down any treatment, cure or drug research.
Since there are several variants of those viruses, if a group of people is immune to a particular kind of virus, it won't be immune for the other types. Also, if a cure, drug or treatment is found for one kind of virus, the other kinds are likely to also be active.
Cats and dogs are also able to carry the viruses and contaminate people with them. However, the viruses don't do anything bad to them.
The viruses are unable to be spread out by other type of animals or plants or dust or whatever.
The viruses won't last long outside of the body of a human, a cat or a dog.
Further, the bioterrorists spread their corrupt influence all around the world and they pervade and corrupt almost everywhere in the world. They will bribe, trick, kill, manipulate, brainwash, whatever, any people that they think that is needed in order to reach their goals, although they won't be successfully every time with that.
Those viruses spread out in the world pretty quickly. Also, the terrorists ensures their major circulation to everywhere.
No matter what the scientists tries to do, they won't be able to save humanity. There are a lot of different kind of viruses, they spread very quickly and in just a few years almost every person in the world is contaminated. Studying even a single type of those viruses is very hard and demands a lot of years in research done by a lot of people and this also takes a lot of money as investment. Also, nobody knows what the heck is going on, at least initially, and until they are able to figure it out, it would be already too late.
In some years no more babies are born and humanity is doomed and eventually dies out.
Except for one place: North Korea!
North Korea extreme isolation allows them to be a place free of those viruses. No matter what the bioterrorists try to do, they always fail to spread the viruses to North Korea. Anyway, initially the bioterrorists didn't payed much attention to that (there were always a lot of many other areas more interesting to work) until it was already too late for them. This also gives North Korea some time to prepare against the outside danger and fortify their defences and also build multiple shells of walls and minefields both on land and sea. When the bioterrorists finally turns definitelly commit on attacking North Korea with all of their resources to finally fullfill their ultimate purpose, they find that North Korea is very well prepared and ahead of their moves. No matter what the bioterrorists try to do, the government always caught them and shoot whoever and whatever tried to come in, including people, cats, dogs, drones, boats and even pigeons and fishes.
The circulation of the viruses worldwide also makes the North Korean be very sure that they shouldn't ever open their borders and ensures that they will have a very legitimate interest to not loose their policy even by a tiny bit. A large part of their economy (not that it was a sizeable economy, but anyway) is actively dedicated to not allow people coming in.
In some years, the rest of the world becomes a place devoid of human activity. There could be a few eldery people thrieving in the ruins of once opulent cities or living simple lifes in isolated farms here or there, but they are all ultimately doomed.
Finally, Pyongyang grows out and embrace virtually all of the North Korea territory, forming a megacity. The city surely features some voids for agriculture, and a large part of the agriculture is performed in the roofs of the houses to improve land usage without hampering urban area growing. Knowing that the the rest of the humanity died out and that the viruses were poorly researched, North Korea will not expand out its borders with the fear of getting contaminated.
Some people might be sent out to study and re-explore the rest of the forsaken world, but they won't ever be allowed back. Further, since outside North Korea there is just wildlife, wastelands, desolation, the possibility of getting contaminated and no chance of coming back later, very few people wants to leave anyway. The few people who actually leave, are too few and too sparse to create a city big enough to deserve being called as such, at least while they don't met with a puppy or a kitty somewhere nearby. Also, sending out drones instead of people is always something much safer to do.