As the deadlines near for Iran and world powers to reach an agreement on the country's nuclear program — the first, on March 31, for a basic political framework — negotiations are focusing on what kind of program Iran can have. How much uranium and plutonium can it have? How many centrifuges can it use to develop more fuel? How long will restrictions be in place?

There's one fact, though, that is taken as assumed: Iran very badly wants a nuclear program. So badly that it has been willing to press ahead with the program, secretly as well as overtly, despite Western and UN sanctions that have crippled its economy, and despite repeated US warnings of possible military action.

Iran claims its program is entirely peaceful, but there are major reasons to doubt this, and it is generally taken as a given by analysts that the country has at least taken just-in-case steps partway toward building a bomb. Some facilities seem to serve little plausible function beyond nuclear weapons capability, though a point that Western intelligence agencies have made in the past is that building the capacity for making a bomb is not the same as deciding to make a bomb.

Whatever Iran's intentions, though, the country's dedication to nuclear enrichment even at such enormous costs can seem bizarrely counterproductive. So why is Iran so set on its nuclear program? There is no one dominant answer, but rather a few plausible explanations, some of which go against the most common Western perceptions and misperceptions of how Iran works. There is probably some truth to all of them.

1) Iran wants to defend against external threats it earnestly fears

Consider Tehran's view for a moment: Israeli and American leaders have been talking for years about bombing Iran or invading it outright. The Bush administration named Iran part of its "axis of evil," alongside Iraq, which it invaded months later. For much of the last decade, the US has had thousands of troops in Iraq and Afghanistan, both Iran's neighbors.

Iranian leaders appear to sincerely believe that the United States is bent on their government's destruction. For example, the United States helped Iraqi leader Saddam Hussein in his brutal, years-long war against Iran, in which he killed thousands of Iranians, including with chemical weapons. It is difficult to overstate how traumatic the years-long war was for Iranians, how badly they want to prevent another such war. And nothing deters chemical weapon attacks like a nuclear weapon.

You will hear Iranians frequently mention Iran Air flight 655, a civilian airliner that the US military accidentally shot down in 1988, killing 290 civilians. In Iran, this is still frequently viewed as deliberate. Imagine you're an Iranian leader seeing all this. You might want a nuclear deterrent.

Also consider the timing of the program. When the ayatollahs came to power in the 1979 Islamic revolution, they at first cancelled the country's nuclear program, but then re-started it after Saddam invaded in 1980.

"Tehran wanted to guard against a future surprise analogous to Iraq's repeated use of chemical weapons," writes Shahram Chubin of the Carnegie Endowment. More recently, Iran has been embroiled in low-level proxy conflicts with Israel and Saudi Arabia, and with what it sees as a defensive conflict against the hostile West.

It's important to remember that Iran sees itself as isolated in the world, despite intimations of occasional Russian or Chinese support. Save for proxies such as Hezbollah and the Syrian government, it sees the Middle East as largely aligned against it. It is also important to remember that its leaders, in power only since 1979, feel weak and isolated. Current Supreme Leader Ayatollah Ali Khamenei in particular has never been very confident in power.

That sense of insecurity feeds into a rational desire for deterrence against external threats, but it also creates a less rational belief in anti-Iran conspiracies or an impending American invasion. When the US threatens to bomb Iran to stop a nuclear program, Iranian leaders can misread this as a desire to destroy the Iranian state itself, which would make them more likely to want a nuclear deterrent, which only makes the US threaten more strenuously.

2) Nuclear enrichment has symbolic importance for Iran

Iran's national pride runs deep, and with good reason: It has been an active center of cultural, scientific, religious and political thought for many centuries. It's also still upset, again with reason, about decades of Western interference during the 19th and 20th centuries.

The nuclear program is a way in which Iran affirms, to itself and to the world, that it is an advanced and sovereign nation. It's a way of saying: we are not inferior to the world powers, even though you treat us that way, but are in fact equals.

It's also a way of defying what Iran sees as continued Western efforts to control, exploit or weaken Iran. The more that the world tells Iran it cannot have a nuclear program, the more important building such a program becomes for the cause of Iranian nationalism.

This is part of why Iranian leaders so often state that they want world powers to affirm Iran's right to enrich uranium and to respect Iran's "dignity" — a word that top officials use frequently. This isn't posturing — they really mean it.

In November 2013, as nuclear talks got underway, Iranian Foreign Minister Javad Zarif released a video articulating Iran's position. He spent very little time talking about actual nuclear policies — the meat and potatoes of the negotiations — and lots of time saying things like, "We expect and demand respect for our dignity." He frequently mentioned phrases such as "equal footing" and "mutual respect." The video was taken as bizarre and inexplicable by Americans, because they could not see that this demand for respect was not a side issue — it was central for Iran.

3) The nuclear program has become a big issue in Iranian domestic politics

There was a brief moment, after the US invasions of Afghanistan in 2001 and Iraq in 2003 (both Iran's neighbors) where Tehran seemed eager to strike a deal with the West over its nuclear program. There are many reasons that fell apart — Dick Cheney personally worked to torpedo any communications, for example — but a crucial one was Iranian politics.

Iran's anti-US hard-liners took the parliament in 2004, and the presidency in 2005 with the election of Mahmoud Ahmadinejad. The hard-liners turned the nuclear program into something of a partisan wedge issue, using it to weaken reformers and moderates who wanted to compromise the program to soften relations with the West.

"Both Ahmadinejad and Supreme Leader Ayatollah Ali Khamenei used the nuclear issue to stigmatize reformists, depicting them as defeatists willing to negotiate away Iran's interests," Chubin writes. "Their use of the nuclear issue as an instrument of partisan politics ended the phase when the nuclear program was supposed to be a national issue. And debate was actively discouraged."

This was great politics for Ahmadinejad and other hard-liners. But it made it much more difficult for him or other Iranian leaders to compromise on the program. They were too invested in the program, politically, to back down — even if backing down would have been in Iran's national interests.

"By 2010," Chubin writes, "the divide over Iran's nuclear program had more to do with domestic politics-and very little to do with what many of the key players actually wanted to see happen."

Ahmadinejad is out of power, but the hard-liners are still powerful. They have particular influence over Khamenei, who as supreme leader is the ultimate decision-maker. Because of the way Khamenei came to power — his religious credentials are weak, and his political credibility never as strong as predecessor and national founder Ruhollah Khomeini — he's long caved to hard-liners, who he fears could turn against him.

4) Iran sees itself as in a struggle for influence in the region — a nuke would help a lot

Since Iran become the Islamic Republic in the 1979 revolution, it has seen the Middle East as a battleground for its influence. This is meant as both defensive and offensive; ever since Saddam invaded, Iranian leaders have feared that hostile, Western-backed Arab leaders could do them terrible harm. And Tehran sees pro-American Sunni powers such as Saudi Arabia as inherently hostile.

But Iran is also expansive and aggressive in the region, supporting proxy terror groups such as Hamas and Hezbollah both as a deterrent against American or Israeli threats and as a way to project its power. In the context of this regional struggle for power, a nuclear weapon starts to make a lot more sense. Not as something that Tehran would want to actually use, but as a way to get away with other sorts of trouble-making.

Clifton W. Sherrill of Troy University explained in a 2012 issue of Nonproliferation Review how Iran could use a nuclear weapon as not just a deterrent but a way to give itself cover for bullying its neighbors and generally projecting more power in the region, where competition for influence is already high, and the stakes are enormous.

"The regime believes nuclear weapons would deter foreign military strikes targeting the Iranian homeland, making the Iranian use of conventional military force abroad less risky," Sherrill writes. "At a minimum, possession of nuclear arms would allow Iran greater policy flexibility in the Middle East."

That likely means using proxy groups, such as Hezbollah in Lebanon, even more aggressively to threaten and bully other countries in the region. That also means pushing harder to support pro-Iran militant groups in countries such as Syria and Yemen where Iran sees itself as competing for influence. The idea is that Iran can be more brazen and aggressive with these non-nuclear threats because its nuclear weapon would scare other countries out of retaliating.

That bullying could also have implications for energy politics; Iran might feel it could force "demands in the Persian Gulf regarding disputed islands or natural gas fields" or "desires regarding production quotas" within OPEC, Sherrill warns. And he points to nuclear-armed Pakistan as an example of how this all can happen:

Pakistan's behavior after its public entry into the nuclear club in 1998 is instructive: it immediately increased support for Islamist militants, creating 1999's Kargil crisis and the standoff with India in 2000 and 2001. In a classic example of the stability-instability paradox, Pakistani confidence that nuclear arms would prevent escalation made limited conventional and terrorist attacks against India possible.

Iran does not want a bomb to launch an offensive strike against another country

Despite widespread misconceptions to the contrary in the US — often pushed by politicians who wish to play up the Iranian threat for political gain — there is no reason to believe that Iran wants to launch an offensive nuclear strike against the US, Israel, or any other country.

The well-established logic of nukes would make any war against other nuclear powers a loser for Iran. This is because powers such as the US and Israel have what is called second-strike capability, meaning that even if Iran got off a nuclear strike, the country would still be destroyed by the retaliation. There is no cost-benefit calculation by which an offensive strike would make sense for Iran.

As Sherrill explained, "It is highly unlikely that the Islamist regime plans to actually detonate a nuclear weapon in an offensive attack. Both of the obvious targets, the United States and Israel, have a second-strike nuclear arsenal capable of threatening the Islamist regime's survival."

Some argue that Iran's leaders are inherently irrational because of their religion and would be willing to launch a suicidal war against the US or Israel. As Newt Gingrich once put it, for example, "It's impossible to deter them. What are you going to threaten?"

The seemingly sole piece of evidence that Iran's leaders have spent the last 36 years secretly plotting a suicidal war is the idea that their interpretation of Shia Islam foretells of a messiah who will return on the apocalypse. While Ahmadinejad did reference this idea many times, he was alone in this, as Matt Duss of the Foundation for Middle East Peace explains, and was widely rebuked by Shia scholars and his own country's political and clerical establishments.

Actual readings of Iran's official Shia theology by actual religious scholars, Duss finds, reach the opposite conclusion that Newt Gingrich did: Iranian leaders see it as their religious duty to preserve their system, not destroy it in a fiery war with Israel. As scholar Mehdi Khalaji told Duss, "As the theory of the guardianship of the jurist requires, the most significant task of the Supreme Leader is to safeguard the regime, even by overruling Islamic law."

Meanwhile, there is ample evidence that Iranian leaders are just as rationally invested in self-preservation as anyone else. You can't hold up a political system as complex and besieged as Iran's without being shrewdly self-interested. If Iran's Islamic regime were really looking for a suicidal war in which to martyr itself, the eight-year war with Iraq offered many such opportunities, none of which they took.

There are a number of reasons that Iran wants a nuclear program and has taken steps toward a nuclear bomb. Some of those reasons are rational and others are not. But a desire to launch an offensive strike against another country is not one of them.