Muslim pilgrims make their way to perform prayers at the Grand Mosque upon their arrival for the annual haj pilgrimage in Mecca in 2011. (Reuters)

For almost 70 years, Saudi Arabia has been a vital U.S. ally in the Middle East. The relationship, which famously opened in a meeting on the Suez Canal between President Franklin D. Roosevelt and the first Saudi king, Abdul Aziz ibn Saud, is based around shared concerns about regional security and crude oil supplies. It has proved remarkably durable, despite a rapidly changing world.

Over the past few months, however, something seems to have shifted. Americans and other Westerners seem to have grown more and more skeptical about the true nature of their ally. In particular, an unusual set of circumstances -- including the fearsome rise of the Islamic State, the death of Saudi King Abdullah and renewed concerns about Saudi links to the 9/11 attacks -- has led to a significant public debate about Saudi Arabia's true values.

One particular source of concern has been the state of human rights in the country, highlighted by a spate of public executions and the high profile punishment of liberal blogger Raif Badawi, who was sentenced to 1,000 lashes for "insulting Islam" last year.

Interest in human rights is a good thing, but there is also a danger of misinterpretation or exaggeration. So, what does the West get right about human rights in Saudi Arabia -- and what does it get wrong? Here's an outline of the facts, as well as the misconceptions.

What is the Saudi legal system based upon?

When Abdul Aziz created the Saudi state in 1932, it was established as an absolute monarchy, strongly influenced by the ultraconservative Wahhabi school of Sunni Islamic thought. Since then, there have been minor reforms (including the introduction of very limited forms of local democracy in 2005), but the system established by Abdul Aziz has largely endured.

As in many Islamic nations, Saudi Arabia's legal system is based around judges interpreting sharia law. It goes further than many, however, in what has been described as "one of the strictest interpretations" of Islamic law in the modern age.

Sevag Kechichian, an Amnesty International researcher, explains that in matters that are not clearly defined in the Koran or the hudud, a section of sharia law on serious crimes, judges have a reasonable amount of discretion, although they must consider precedents set by other judges and laws implemented by the government (such as recent counterterrorism and cybersecurity laws).

How does this affect human rights?

Most outside observers agree that the strict use of Islamic law and a lack of checks and balances have a very negative effect on human rights in Saudi Arabia.

For example, Freedom House, an American nongovernmental organization that tracks human rights, currently rates Saudi Arabia as "not free" and gives it the lowest possible score in its rankings. It was one of only 10 countries in the entire world to receive that score: North Korea, Syria and Sudan are three of the others.

Demonstrators take part in an Amnesty International protest in front of the Saudi Embassy in London on Jan. 22. (FACUNDO ARRIZABALAGA/European Pressphoto Agency)

In 2013, the U.S. State Department listed the reports of the "worst" human rights abuses in Saudi Arabia, which included "citizens’ lack of the right and legal means to change their government; pervasive restrictions on universal rights such as freedom of expression, including on the Internet, and freedom of assembly, association, movement, and religion; and a lack of equal rights for women, children, and noncitizen workers."

What happens to those who dissent politically?

In the past, Saudi officials have denied that any "political prisoners" exist, but activist groups have estimated that there might be as many as 30,000 people imprisoned for political purposes. Last year, Human Rights Watch noted that a number of Saudi human rights activists were given lengthy prison terms on vague charges such as “setting up an unlicensed organization" and "disobeying the ruler."

The latter charge is illustrative of how religious law can be used for political purposes. "It's a smart play on their part on what initially is a Quranic term that literally translates as coming out to disobey the caretaker of Muslims, with the emphasis on the coming out, which is used in the double sense of emerging publicly to protest, other than disobeying," Kechichian of Amnesty International explains.

How are women affected?

Saudi Arabia's restrictions on women are internationally infamous: Women can't get driving licenses, meaning that, legally, they cannot drive. Women are also expected to keep their heads covered with scarves and wear loose fitting garments such as an abaya when in public. And adult women need to have a "male guardian's" permission to do things like work or travel, a severe restriction on their freedom.

Because of these factors, international bodies consistently rank Saudi Arabia low on matters of gender equality. In 2014, the World Economics Forum ranked it 130 out of 142 countries in its annual report on gender equality.

That said, there are variations across the country. In more liberal areas of the country, such as Jiddah, the dress code for women is relatively relaxed (though still evident): Brightly covered abayas can be worn, or sometimes the cloak is worn open to show the clothes underneath. And while women can't legally drive without licenses, Bedouin women and women in the southern provinces often drive, regardless.

Despite the restrictions, Saudi women do play a big role in society: Ali H. Alyami, the director of the Center for Democracy and Human Rights in Saudi Arabia (CDHR), points out that many women are now studying at universities and are, as he puts it, "doing better than men."

What other segments of society suffer?

While Saudi Arabia is dominated by an ultraconservative Sunni ideology, an estimated 15 percent of the country's Muslims are Shiite. Human rights groups say the Shiites face discrimination based on their faith -- last year, the sentencing of one prominent Shiite cleric to death sparked international criticism. Other non-Islamic religious minorities have also complained of discrimination.

Given that ultraconservative ideology, LGBT rights are severely neglected in the country, too: By law, the punishment for sodomy could be stoning to death. Migrant workers, of which there are millions in Saudi Arabia (mostly from South Asia), can also face abuse and have little in the way of legal rights. Last year the Saudi government announced it had deported 250,000 in just three months.

Is blasphemy a crime?

Yes, both blasphemy and apostasy are considered serious crimes in Saudi Arabia. Under the strict interpretation of Islamic law used by Saudi Arabia, blasphemy can be punished by death.

Again, charges related to religion can often serve quite clear political purposes: Democracy activists Ali al-Demaini, Abdullah al-Hamed and Matruk al-Faleh were originally imprisoned on charges of using "un-Islamic terminology" -- meaning terms such as  "democracy" and "human rights" -- when they called for a written constitution. The flogging of Badawi came after he was found guilty on vague charges of "insulting Islam."

What sort of punishments are used?

Saudi Arabia makes use of corporal punishment, including amputations of limbs, although floggings are most commonly used. Executions are also widespread. Both are performed publicly.

Last year Amnesty International noted a "disturbing" rise in the number of executions in Saudi Arabia, which included public beheadings and "crucifixion" (which refers to the display of the body after death, rather than the term familiar in Christianity). In 2013, there were at least 79 executions, Amnesty says, more than double the number in the United States that year. In fact, only China, Iran and Iraq executed more people than Saudi Arabia in 2013.

Human rights groups say that Saudi judges often hand out executions for relatively minor crimes. "Any execution is appalling, but executions for crimes such as drug smuggling or sorcery that result in no loss of life are particularly egregious,” Sarah Leah Whitson, Middle East and North Africa director for Human Rights Watch, said last year.

Over the past few months, observers have noted that these sort of punishments don't look so different from those used by the Islamic State, an enemy of both Saudi Arabia and the United States. That comparison irks many Saudis.  "When we do it in Saudi Arabia, we do it as a decision made by a court," an Interior Ministry spokesman, Maj. Gen. Mansour al-Turki, told NBC News recently. "The killing is a decision. I mean it is not based on arbitrary choices, to kill this and not to kill this."

In extreme and unpopular cases, political leaders may step in. In 2007, for example, a female rape victim was sentenced to 200 lashes in case that shocked many Saudis, prompting the late King Abdullah to step in and pardon her.

Who are the religious police?

Saudi Arabia's infamous "religious police" are employees of the Committee for the Promotion of Virtue and the Prevention of Vice. Their job includes ensuring that men and women do not mix socially, that people do not dress immodestly and that businesses close during prayer time. Over the years, members of the "mutaween" have been criticized for overstepping their mark -- most notoriously in 2002, when agents were accused of blocking the doors at a burning school as the schoolgirls were not wearing proper attire. With the rise of social media, criticism of the religious police appears to have grown.

Under the relatively liberal leadership of Abd al-Latif al-Shaykh (ironically, a descendant of Shaykh Muhammad Ibn Abd al-Wahhab, the founder of Wahhabism), there had been big moves to rein in and reform the religious police over the past few years. However, Shaykh has lost this position under the new King Salman, so it is unclear how these reforms will progress.

How do these rules apply to foreigners?

Saudi Arabia's bigger cities attract many foreigners. While foreigners live under the same laws as Saudi citizens, there are some cases where exceptions are made. The most obvious example is attire for women, as clearly shown by first lady Michelle Obama and other prominent Western women meeting with the Saudi royal family with their hair uncovered. In general, Western women aren't required to wear headscarves or veils, though many choose to anyway (the U.S. State Department recommends it).

Foreigners can face trouble from the Saudi religious police. In September, a video of a British man scuffling with a number of mutaween in Riyadh, reportedly for using a women-only check-out line at a supermarket, went viral on the Saudi Web. The Committee for the Promotion of Virtue and the Prevention of Vice subsequently apologized to the Briton.

Do people support the government's harsher laws?

Some foreigners are taken aback by the lack of response from some Saudis to their own strict laws. Janet Breslin-Smith, wife of former U.S. ambassador to Saudi Arabia James B. Smith, says that one of the things that surprised her most upon arrival in Riyadh was the attitudes of the people. She had worked on subjects related to human rights in Latin America, where she had made an assumption that  "repressive regimes hold down a population yearning for liberty, justice, freedom."

In Saudi Arabia, however, things seemed different. "The Saudi culture, history, theology – both belief and practice – permeated society," Breslin-Smith says, adding that she found little desire for democracy from most people when she moved in 2009. "The 'masses' were not mobilizing for change and the rulers – at that time – were actually the ones raising some of these issues."

One big example of this in action is attitudes to woman's rights. Some polls have found a majority of Saudi women not in favor of allowing Saudi women to drive. "When you have a discussion with someone's living in a village outside the big cities in Saudi Arabia, not everyone really supports women's rights,"  Rajaa Al Sanea, a dentist and Saudi writer, told NPR recently. "So we need to work on that before we implement any decisions that will create a drastic change in the society."

Has there been progress?

When King Abdullah died, a number of publications (including this one) referred to him as a "reformer." A lot of human rights activists took umbrage with that. Ali H. Alyami of CDHR argues it is a Western misconception that any real reform has taken place: He argues that moves taken by King Abdullah, such as appointing women to his Shura Council (which advises the Saudi leader) or introducing limited local democracy were cosmetic at best.

Not everyone sees it the same way. Fahad Nazer, a former political analyst at the Saudi Embassy in Washington says that if you look longer term, things have clearly progressed – albeit "slowly and gradually" – since the time of the Gulf War. "The whole idea of  human rights itself was seldom discussed in Saudi Arabia a few decades ago," he writes in an e-mail. "It just wasn't a part of the Saudi political lexicon."

Nazer points to the two government-affiliated human rights organizations who have set up and the growth of Saudi awareness about the rights of migrant workers. Even Alyami, sternly critical of King Abdullah, believes under the late monarch there was a change of perceptions among the Saudi public, if not its leaders, about issues such as women's rights and the role of democracy.

That said, as The Post's Kevin Sullivan reported recently, there does appear to have been a clear crackdown on free speech in Saudi Arabia over the past year or so. Human rights activists link the shift to two factors: Fears emanating from the 2011 Arab Spring protests and pressure from the country's religious conservatives. It's unclear what direction the new King Salman will take the country.

What more could the U.S. do?

When President Obama traveled to Riyadh recently to pay his respects, reporters were told that he did not bring up Raif Badawi's flogging, despite its high profile. That fits into a pattern for the United States, which rarely brings up specific concerns about Saudi human rights, in public at least.

For many, the double standards here are jarring. "On the one hand, the Obama administration condemns the beheadings, torture and crackdowns conducted by the armed group Islamic State," Sunjeev Bery, advocacy director at Amnesty International USA, said. "On the other hand, the White House is relatively quiet when Saudi Arabian authorities engage in some of the exact same human rights abuses."

Part of this is because the core of the U.S.-Saudi relationship – energy and security – relies on a stable Saudi Arabia. Given that there doesn't appear to be public unrest calling for reforms, the United States is cautious about undermining the Saudi government in any way.

That attitude disappoints many in Saudi Arabia who see the impact of foreign pressure in specific cases: For example, Badawi's case received international media attention, his floggings were repeatedly suspended. As one Saudi activist, who spoke on the condition of anonymity out of concerns of government retribution, explained in an e-mail, "global attention is the only leverage we have as subjects in an absolute monarchy." For this activist, a big problem is that there are many other similar cases that don't receive any attention at all.