South Koreans shout slogans welcoming U.S. President Obama to Seoul in 2009. (Chung Sung-Jun/Getty Images)

When it comes to global public opinion, the United States can be polarizing: Often, you either love us or you hate us. But although we in the U.S. might perceive certain countries as intrinsically pro-American or anti-American, the truth is more complicated and attitudes can be more fluid.

A great example of this is South Korea, where opinion toward the U.S. has transformed in only a decade, from skeptically apathetic to warmly supportive. South Korea today is one of the most pro-American countries in the world; 77 percent say they have confidence in President Obama's leadership, almost double Americans' own 45 percent approval rating.

As South Korean President Park Geun-hye visits Obama today, it's worth reflecting on the lessons of South Korea's turn back to the United States.

As of 2002, when most of the world reported sky-high favorability ratings for the U.S. – it was still soon after the Sept. 11, 2001, attacks – South Koreans held some of the least favorable views of the U.S. in the world, according to Pew's data on global opinion. Only Middle Eastern countries (and Argentina) liked the U.S. less. The next year, in 2003, South Koreans were more likely to hold an unfavorable view of the U.S. than favorable.

Source: Pew

In 10  years' time, though, South Korean public opinion has swung dramatically in favor of the United States. According to new data released by Pew, an astounding 78 percent of South Koreans say they hold a favorable view of the U.S. That's the highest pro-American approval rating that Pew has recorded in the past year. (Kenya may rate higher, though; it reported 85 percent approval in 2011 and has not been polled by Pew since.)

So what happened? The U.S. and its policies certainly played a role, particularly by keeping tens of thousands of American troops based on South Korean soil. But those troops are still there and South Korean opinion has changed dramatically. That appears to have happened in large part due to social forces within South Korea itself.

In 2002, a young rapper named Park Jae-sang performed alongside several other top South Korean musicians in a massive concert meant to protest the U.S. military bases in their country. Park would later become famous as Psy, the singer of "Gangnam Style." The performance was sort of like Live Aid, except instead of raising money for starving Ethiopians they were stomping cardboard models of American tanks.

The concert, like anti-American protests around the same time, was on the surface a response to an incident that June when one of the many U.S. military vehicles in South Korea struck and killed two 14-year-old girls walking along the side of a road outside Seoul. Because of the terms of the U.S.-South Korean treaty that allows for America’s military presence there, the incident was considered a “military operation” and thus outside of Korea’s jurisdiction. A U.S. court martial acquitted the driver and his commander.

Furious at the acquittal, Koreans protested for months, some seeing echoes of the foreign empires that had dominated their country for centuries. Universities became hotbeds of anti-American rage. A Gallup poll found that 75 percent of 20-something Koreans said they disliked or hated Americans. Many charged that the United States was making South Korea its pawn.

It's easy to sympathize with South Koreans unhappy with a foreign military presence and enraged that the accidental killers of two young girls might go free. Still, as I've written previously, there was something more at work.

One of those forces is the “Sunshine Policy,” South Korea’s pursuit of rapprochement with North Korea from 1998 to 2008. The policy attempted to soften the tension between the two Korean nations, something that often required breaking, rhetorically or even politically, with the United States. President Roh Moo-hyun did this in part by criticizing the U.S. containment policy – and thus, implicitly, the enormous American military force stationed in his country – in an effort to demonstrate goodwill toward North Korea and, he hoped, to lay the groundwork for real cooperation. A 2003 State Department report warned that the Sunshine Policy, and the political rhetoric and media coverage it produced within South Korea, were raising anti-American sentiment and risking the entire U.S.-South Korean alliance.

But there is also something perhaps deeper, something alluded to in the 2002 protests, in which Koreans accused Washington of trying to control their country, as past Asian empires had done. As South Korea transitioned from military dictatorship to democracy, and from a poor rural country to an advanced urban society, Koreans started to feel “new stirrings of nationalism arising from their country’s rapid economic growth and political liberalization,” historian Jinwung Kim has written. That nationalism manifested, in part, as a rejection of “Korea’s ‘big brother,’ the United States,” Kim wrote. Research by Katherine H.S. Moon, an academic at Wellesley College, linked the “rejection of authoritarianism” and growing national consciousness to “resurgent nationalism” and a newly mainstream anti-Americanism.

These attitudes peaked in the late 1990s and early 2000s – just as Psy dropped a model tank before cheering crowds in Seoul – and, Moon writes, focused on the ever-visible American military presence. South Koreans were newly organizing themselves around a national pride and consciousness. But their nationalist energies, which they had developed as they formed a civil society and rejected the military dictatorship, suddenly lacked an outlet. Probably no one decided to refocus those energies on opposing the U.S. military presence, but it’s not hard to see how that might have happened organically, as Moon suggests. Though the U.S. force serves South Korean interests, it also can be seen as an insult to Korean nationalism, a reminder that it still relies on outside powers, and an intimation, however true or false, that the country might not be fully in Korean control.

In the mid-2000s, though, South Korea started downgrading its Sunshine Policy and shifting back toward the U.S. Partly this was due to internal politics, which saw power shift from the pro-Sunshine left to the pro-American right. But North Korea also helped, reneging on past agreements, aggressively expanding its nuclear weapons program and, in the process, alienating South Korea and accelerating Sunshine's demise.

It's hard to see these lessons applying directly to, for example, Pakistan, where only 11 percent approve of the U.S., according to Pew data out today. There's no Sunshine Policy in Pakistan and it would be difficult to downplay the effect of U.S. policies, particularly drone strikes, on public opinion there. But maybe a lesson we draw is that public opinion toward the U.S. can change from negative to positive, and quickly, given the right circumstances.