Jeffrey Toobin is CNN senior legal analyst and author of " The Oath: The Obama White House and the Supreme Court ." The opinions expressed in this commentary are solely those of the author.

(CNN) The justices of the Supreme Court practice politics as much as law -- and that will be clearer than ever when the issue of same-sex marriage comes before the court on Tuesday.

Public opinion on same-sex marriage has turned upside down since the Supreme Judicial Court in Massachusetts first legalized the practice in 2003. Overwhelming opposition has turned into substantial majority suppor t, especially among young people of all political persuasions. Even the name of the issue has changed -- to marriage equality.

Of course, the Constitution has not changed since 2003, a point that will surely be made by such opponents of same-sex marriage as Justice Antonin Scalia. To originalists like Scalia -- those who believe the Constitution should be interpreted only as it was originally understood by the framers -- the idea of a constitutional right to same-sex marriage is anathema.

To them, the Constitution means only what it meant to those who wrote it -- and James Madison (or the authors of the 14th Amendment , just after the Civil War) never gave a thought to whether they were granting gay people the right to marry.

But the Supreme Court has always been about a lot more than the intentions of the framers. And public opinion is just one of the extrajudicial factors that the justices sometimes take into consideration.

In 1954, the Supreme Court ruled unanimously that public schools could no longer segregate students by race, even though the authors of the 14th Amendment clearly considered segregated schools to be permissible.

Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Hollingsworth v. Perry (2013): The Supreme Court dismissed an appeal over California's Proposition 8 on jurisdictional grounds. The voter-approved ballot measure barring same-sex marriage was not defended by state officials, but rather a private party. This ruling cleared the way for same-sex marriage in California to resume, but left open-ended the legal language of 35 other states barring same-sex marriage. Take a look at other important cases decided by the high court. Hide Caption 1 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – United States v. Windsor (2013): When her wife died in 2009, Edith Windsor, 84, was forced to pay hundreds of thousands of dollars in estate taxes because her marriage was not recognized by the federal government's Defense of Marriage Act of 1996. The Supreme Court struck down the part of the law which denied legally marriage same-sex couples the same federal benefits provided to heterosexual spouses. Hide Caption 2 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – National Federation of Independent Business v. Sebelius (2012): The Supreme Court upheld most of the Affordable Care Act, the Obama administration's health care reform law, on June 28, 2012. The decision determined how hundreds of millions of Americans will receive health care. Hide Caption 3 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Citizens United v. Federal Election Commission (2010): Activists rally in February 2012 to urge the Supreme Court to overturn its decision that fundamentally changed campaign finance law by allowing corporations and unions to contribute unlimited funds to political action committees not affiliated with a candidate. Hide Caption 4 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Texas v. Johnson (1989): The Supreme Court overturned the decision that convicted Gregory Lee Johnson of desecrating a venerated object after he set an American flag on fire during a protest. The court ruled that Johnson (at right with his lawyer, William Kunstler) was protected under the First Amendment right to freedom of speech. Hide Caption 5 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – United States v. Nixon (1974): When President Richard Nixon claimed executive privilege over taped conversations regarding the Watergate scandal, the Supreme Court ruled that he had to turn over the tapes and other documents. The ruling set a precedent limiting the power of the president of the United States. Hide Caption 6 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Roe v. Wade (1973): Norma McCorvey, identified as "Jane Roe," sued Dallas County District Attorney Henry Wade over a law that made it a felony to have an abortion unless the life of the mother was in danger. The court agreed with Roe and overruled any laws that made abortion illegal in the first trimester. Here, McCorvey, left, stands with her attorney Gloria Allred in 1989. Hide Caption 7 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Miranda v. Arizona (1966): Ernesto Miranda confessed to a crime without the police informing him of his right to an attorney or right against self-incrimination. His attorney argued in court that the confession should have been inadmissible, and in 1966, the Supreme Court agreed. The term "Miranda rights" has been used since. Hide Caption 8 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Gideon v. Wainwright (1963): The Supreme Court overturned the burglary conviction of Clarence Earl Gideon after he wrote to the court from his prison cell, explaining he was denied the right to an attorney at his 1961 trial. Hide Caption 9 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Mapp v. Ohio (1961): The Supreme Court overturned the conviction of Dollree Mapp because the evidence collected against her was obtained during an illegal search. The ruling re-evaluated the Fourth Amendment, which protects citizens against unreasonable searches and seizures. Hide Caption 10 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Brown v. Board of Education (1954): Nathaniel Steward recites his lesson surrounded by white classmates at the Saint-Dominique School in Washington. In Brown v. Board of Education, the Supreme Court ruled that it was unconstitutional to separate students based on race. Hide Caption 11 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Korematsu v. United States (1944): Fred Korematsu, a Japanese-American man, was arrested after authorities found out that he claimed to be a Mexican-American to avoid an internment camp during World War II. The court ruled that the rights of an individual were not as important as the need to protect the country during wartime. In 1998, President Bill Clinton awarded Korematsu the Presidential Medal of Freedom. Hide Caption 12 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Plessy v. Ferguson (1896): Homer Plessy was arrested when he refused to leave a whites-only segregated train car, claiming he was 7/8 white and only 1/8 black. The Supreme Court ruled that "separate but equal" facilities for blacks were constitutional, which remained the rule until Brown v. Board of Education in 1954. Hide Caption 13 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Dred Scott v. Sandford (1857): When Dred Scott asked a circuit court to reward him his freedom after moving to a free state, the Supreme Court ruled that Congress didn't have the right to prohibit slavery and, further, that those of African-American descent were not protected by the Constitution. Hide Caption 14 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Gibbons v. Ogden (1824): This was the first case to establish Congress' power to regulate interstate commerce. The ruling signaled a shift in power from the states to the federal government. Aaron Ogden, seen here, was given exclusive permission from the state of New York to navigate the waters between New York and certain New Jersey ports. When Ogden brought a lawsuit against Thomas Gibbons for operating steamships in his waters, the Supreme Court sided with Gibbons. Hide Caption 15 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – McCulloch v. Maryland (1819): In response to the federal government's controversial decision to institute a national bank in the state, Maryland tried to tax the bank out of business. When a federal bank cashier, James W. McCulloch, refused to pay the taxes, the state of Maryland filed charges against him. In McCulloch v. Maryland, the Supreme Court ruled that chartering a bank was an implied power of the Constitution. The first national bank, pictured, was created by Congress in 1791 in Philadelphia. Hide Caption 16 of 17 Photos: Photos: Supreme Court cases that changed America Supreme Court cases that changed America – Marbury v. Madison (1803): When Secretary of State James Madison, seen here, tried to stop Federal loyalists from being appointed to judicial positions, he was sued by William Marbury. Marbury was one of former President John Adams' appointees, and the court decided that although he had a right to the position, the court couldn't enforce his appointment. The case defined the boundaries of the executive and judicial branches of government. Hide Caption 17 of 17

Chief Justice Earl Warren, who wrote the opinion in Brown v. Board of Education, recognized that the world had changed, especially in light of the Cold War. Warren knew that segregated schools damaged the United States' reputation in the contest for hearts and minds around the world, and he steered the court accordingly.

Warren's motives had nothing to do with the framers' intentions, and little to do with the words of the Constitution itself, but these kinds of motivations have been common throughout the history of the Supreme Court.

There are risks, of course, when the justices are guided by more than the text and history of the Constitution. Like everyone else, the justices have imperfect instincts when it comes to measuring public attitudes.

Justice Ruth Bader Ginsburg is a fervent supporter of abortion rights for women, but she has expressed reservations about the court's decision in Roe v. Wade, the 1973 ruling that required all 50 states to legalize abortion. She has argued that the court interrupted a political process for legalization that was already underway, and that the case ignited a backlash that wound up hurting the cause of abortion rights.

JUST WATCHED What in the World: Global lessons on gay marriage Replay More Videos ... MUST WATCH What in the World: Global lessons on gay marriage 03:58

Her position is debatable on several scores. Abortion rights were not ascendant everywhere in the '70s, and opponents were already well mobilized. But Ginsburg's misgivings about Roe have served as an important backdrop to the Supreme Court's consideration of same-sex marriage.

Still, when it comes to Supreme Court decisions, it is usually safe to bet that a majority of the justices will come down on the side favored by most of the public. In any case, as we head into the argument, it looks like most of the justices have already made up their minds.

After the court decided United States v. Windsor in 2013, which invalidated most of the 1996 law known as the Defense of Marriage Act, more than a dozen federal district courts around the county said the reasoning of that case required the legalization of same-sex marriage. These judges allowed these marriages to begin taking place around the country. Supporters of the existing laws went to the Supreme Court and asked for stays of the lower court rulings, because the justices themselves had not yet permitted the marriages to take place.

JUST WATCHED Republicans walk tightrope on gay marriage Replay More Videos ... MUST WATCH Republicans walk tightrope on gay marriage 03:52

But in each case, the Supreme Court denied the stays and allowed same-sex marriages to proceed -- those marriages are now legal in 37 states and the District of Columbia. In a brief dissenting opinion from the failure to grant the stays, Justice Clarence Thomas suggested the issue had already been settled in the minds of his colleagues. "This acquiescence [in allowing marriages to proceed] may well be seen as a signal of the court's intended resolution of that question," Thomas wrote. "This is not the proper way to discharge our ... responsibilities."

But Thomas only drew Scalia to join his dissent, suggesting that even fellow conservatives Chief Justice John Roberts and Samuel Alito saw the writing on the wall.

In any case, at oral argument, we'll get a clue what the justices are thinking about the issue. But we already know that their decision, like so many in the court's history, will be based on a great deal more than the text of the Constitution.