(CNN) -- President Barack Obama's announcement that he now supports same-sex marriage reflects a dramatic shift taking place across the country.
Last year, for the first time, polls found a majority of Americans share that stance.
Surveys show the country's position has undergone a rapid change over the past 15 years -- one not seen on other issues.
On climate change, abortion and the death penalty, "we're not seeing Americans necessarily becoming more liberal," said Frank Newport, editor in chief of Gallup. "This one stands a little alone."
In 1996, Gallup found 27% of Americans supported same-sex marriage, while 68% opposed it. Last year, 53% of Americans supported same-sex marriage, while 45% opposed.
This year, Gallup found the country almost evenly split, with 50% supporting same-sex marriage and 48% against it. Sampling error could explain the apparent change from 2011.
A CNN/ORC International poll found in September that 53% of Americans supported same-sex marriage, up from 44% in 2008.
American attitudes have seen dramatic changes on some other issues, Newport noted, but the changes generally have taken much longer. "The number of people who said they would vote for an otherwise well-qualified black president used to be well below 50%, but decades later it's up to 95% or higher," he said. It's been similar for the idea of a woman president.
Two main factors are driving the increased acceptance of same-sex marriage, said David Masci, senior researcher with the Pew Forum on Religion and Public Life, whose surveys have found a similar change.
The first is "a cultural shift that's been going on for decades -- not just same-sex marriage, but broader acceptance of gays and lesbians."
He points to changing depictions of gay people and fictional characters in media -- something Vice President Joe Biden referred to Sunday on NBC's "Meet the Press."
The sitcom "'Will and Grace' probably did more to educate the American public than almost anything anybody's ever done so far," Biden said.
The second key factor, Masci said, is young people.
So-called Millennials, born since 1981, are by far the most supportive of same-sex marriage.
Obama, in announcing his new stance this week, pointed out that his daughters have "parents whose friends are same-sex couples. It wouldn't dawn on them that somehow their friends' parents would be treated differently. And frankly, that's the kind of thing that prompts a change of perspective."
He also said college Republicans he meets, who dislike his economic and foreign policies, often express support for same-sex marriage.
Pew found 63% of Millennials support same-sex marriage, while 30% of people born between 1928 and 1945 support it.
So the changing attitudes in America aren't just the result of people changing their minds. They're also the result of a changing electorate.
As more young people become old enough to be polled and vote, and more of the oldest Americans die, the figure skews upward.
Still, Pew found that even among the oldest Americans, support for same-sex marriage has gone up over the past 10 years.
And while younger people sometimes move toward more conservative positions as they get older, Newport said the change on same-sex marriage "seems like something that will stick with them."
There have been a few years recently in which polls found support for same-sex marriage had dropped slightly. However, Gallup and Pew found those in different years, and pollsters said they can't be sure what caused the change. An increase in opposition sometimes follows a controversial court decision, they said.
Across the country, there are regional differences in where voters stand, which partly explains why North Carolina this week became the 31st state in which voters supported a constitutional amendment defining marriage as between a man and a woman. Also, the national surveys assess overall voter attitudes -- not just the attitudes of those who will show up to vote on a specific question in a specific state.
While the survey trends are unmistakable, they could reverse themselves at any time, Masci says.
"One thing to be careful about is the idea of an inevitable march toward acceptance of (same-sex marriage). If I were a betting man I would be, but there's no guarantee," he said.
And, he said, "it doesn't mean that five or 10 years down the road we won't still be a divided country on this."