There are 28,000 US military personnel in South Korea. That’s the lowest level in 70 years.
South Korea wasn’t a democracy until 35 years after the end of the Korean war. There have been like 5 US combat deaths in Afghanistan in the Biden administration, and none in 18 months. The cost of staying was low. Leaving puts millions of people under your be of the worst dictatorships in the world, and it’s not like the Taliban has severed their ties with al Qaeda or IS.