WASHINGTON (CNN) -

President Barack Obama once believed marriage was only between a man and a woman.

He then backed civil unions for gay and lesbian couples, granting them many of the same rights and privileges as married heterosexuals.

Now he firmly supports a constitutional right that has put him at odds with many social conservatives.

It is a personal and political evolution that in many ways reflects the country as a whole. Shifting public opinion and old fights over judicial power are at the nexus of perhaps the most important social issue the high court has addressed in recent years: same-sex marriage.

There about 120,000 legally married homosexual couples in the United States. Many thousands more seek the same thing. But it may be 10 people who have the power to force immediate, real change on this legal, political, and social issue: the nine justices and Obama himself.

How U.S. political leaders and the Supreme Court act in coming months could set the template for years on a contentious topic that shows no sign of cooling.

"The argument that the Obama administration has made is the Supreme Court should look at these laws very carefully because gays and lesbians are a group that have been subject to discrimination in the past and will be subject to discrimination going forward," said Amy Howe, a legal analyst and editor of SCOTUSblog.com.

"So the Supreme Court would need to subject these laws to what we call a very stringent standard of review" balancing the government's justification for enacting them, she added.

Two separate appeals to be argued Tuesday and Wednesday will once again put the high court at center stage, a contentious encore to its summer ruling upholding the health care reform law championed by Obama.

Nine states and the District of Columbia allow same-sex marriage, including Washington, Maryland, Maine, Iowa, New Hampshire, Vermont, Massachusetts, Connecticut, and New York. Another nine have civil union or strong domestic partnership laws.

The high court will consider two appeals.

The first involves the federal Defense of Marriage Act. DOMA is a 1996 law that defines marriage between one man and one woman. That means federal tax, Social Security, pension, and bankruptcy benefits, family medical leave protections, and other provisions do not apply to gay and lesbian couples.

Edie Windsor, an 84-year-old New York woman, is the key plaintiff. She was forced to pay more than $363,000 in extra estate taxes when her longtime spouse, Thea Spyer, died.

The second case involves California's Proposition 8, a 2008 referendum that abolished same-sex marriage after the state's highest court ruled it legal.

The Supreme Court is being asked to establish same-sex marriage as a constitutional right, but could also decide a more narrower question: Whether a state can revoke that right through referendum once it has already been recognized.

Running for the Illinois state senate in 1998, Obama said he was "undecided" about whether to legalize same-sex marriage. Fast-forward six years to when he ran for U.S. Senate. He then declared a belief that marriage is between a man and a woman.

The stance began an internal process over time that was by his admission, anything but smooth.

"My feelings about this are constantly evolving. I struggle with this," he said in 2010, two years into his presidency.

"At this point, what I've said is that my baseline is a strong civil union that provides them the protections and the legal rights that married couples have," Obama said at the time.

Eight such states have civil union or strong domestic partnership laws-- Delaware, Hawaii, Illinois, Nevada, New Jersey, Oregon, and Rhode Island. But it is the California case that really has drawn the Obama administration into the fight.

Obama signaled earlier this month he was prepared to assert a vigorous constitutional right to marriage, but confine it for now only to the Proposition 8 matter and perhaps to the seven other states with civil union laws like California's.

The Justice Department argues civil union and domestic partnership laws may themselves be unconstitutional and that those states should go all the way and grant same-sex couples full marriage rights.

It's called the eight-state strategy.

"The object of California's establishment of the legal relationship of domestic partnership is to grant committed same-sex couples rights equivalent to those accorded a married couple. But Proposition 8, by depriving same-sex couples of the right to marry, denies them the dignity, respect, and stature accorded similarly situated opposite-sex couples under state law," the Justice Department said in its brief on the case.

Gay rights groups had privately urged Obama and his top aides to go beyond his previous personal rhetoric in support of the right, and come down "on the side of history" in this legal struggle.