NEW YORK (AP) - When Detroit became the biggest city in U.S. history to file for bankruptcy last month, it turned public attention to the municipal-bond market, where cities and states go to borrow money. Was this sleepy, often-overlooked area of the financial world actually dangerous?

NEW YORK (AP) When Detroit became the biggest city in U.S. history to file for bankruptcy last month, it turned public attention to the municipal-bond market, where cities and states go to borrow money. Was this sleepy, often-overlooked area of the financial world actually dangerous?

Like other cities, Detroit borrowed from investors to pay for roads, sewer lines and an array of other projects. Now Detroit says it can't afford to pay bond investors all of their money back.

Even if you don't own any muni bonds, it's important to understand what they are and how they work. They're what your city uses to keep itself running, but it can be tough to cut through the jargon and heated claims surrounding Detroit's bankruptcy. To help, here's a look at the nuts and bolts of what finance types call munis: who owns them, how they work and just what they are, anyway.

What are municipal bonds, exactly?

Cities, states, towns and other local governments sell municipal bonds to raise money for school renovations, sports stadiums or other projects. A fire district might need a few hundred thousand dollars for a new truck; a state might need a few billion to build highways and hospitals.

When investors buy a muni bond, they're lending to a local government. In return, they get a regular interest payment and the promise of all their money back at the end of the bond's life. That could be one year later or as many as three decades later.

Have local governments borrowed a lot?

The total amount of municipal debt outstanding is $3.72 trillion, according to the Federal Reserve's latest report. That may sound enormous, but it's less than a fifth of the total $21.7 trillion U.S. bond market. Corporations have borrowed more money, owing $5.9 trillion to bondholders. And the federal government has more publicly traded debt than both groups put together: $11.9 trillion.

For the sake of comparison, the value of the entire U.S. stock market is $18.7 trillion, according to S&P Dow Jones Indices.

What's the appeal?

It's mainly the tax-free income. The federal government taxes interest payments from savings accounts, corporate bonds and other investments, but doesn't touch income from muni bonds. To somebody in the top tax bracket, a New York State bond paying 3 percent is equal to a corporate bond paying 4.97 percent.

Who owns them?

They're mainly held by individuals, who buy them outright or through mutual funds. Individuals hold 44 percent of all munis, and mutual funds have another 25 percent, according to the Fed. Banks and insurance companies own much of the rest.

Buying municipal bonds directly tends to be the province of wealthy people who have the most to gain from the tax exemption.

"Tax-free bonds have been the best game in town for people who are well off and don't want to pay taxes," said Mark Schwartz, a former bond lawyer and investment banker who has a law practice in Bryn Mawr, Pa.

How can I buy them?

You can usually buy munis through your online brokerage account, but it's not exactly like buying stocks. They're traded "over the counter." That means there is no formal, centralized exchange with one agreed-upon price for a security. Instead, you have to buy them through a dealer, and the prices may vary.

"You can call up five dealers and get five different prices," said Daniel Berger, senior market strategist at Thomson Reuters, "although the prices would be closer than you think."

Dealers are supposed to offer "fair and reasonable" prices. They make money from the difference between what they paid and what they get from a sale.

What kind of return can you expect?

When there's little risk, there's little reward. Thanks to their solid credit history, municipalities pay very low rates to borrow money.

A type of muni called a "general obligation" bond is considered especially safe. They're backed by a city's full faith and credit, which essentially means a city will take extreme steps to repay them even if it has to cut police and fire protection for its citizens or raise taxes.

The average yield on a top-rated, 10-year general-obligation muni bond is 2.71 percent, according to Thomson Reuters data. For a 30-year muni, it's 4.22 percent.

That's a bit more than the payout on U.S. government debt, and the tax break makes the benefit bigger for investors. The 10-year Treasury note yields 2.62 percent. The 30-year bond yields 3.70 percent.

What's going on in Detroit?

Detroit owes billions to bondholders and billions more in pensions to retired city workers. In its bankruptcy filing, the city proposed trimming pension benefits and paying bondholders a fraction of what they're owed. It also wants to treat retired city workers and bond investors as equals.

Both groups plan to fight the city's proposal, for very different reasons. The retirees argue that Michigan's state constitution protects their pensions. Investors who hold the city's general-obligation bonds expect not only to rank first in the lineup of creditors but also to be paid in full. Laws often require local governments to pay bondholders before they pay anybody else.

Government borrowers generally stick to their promised interest payments as long as residents keep paying taxes. Even when trouble strikes, bondholders usually get all their money back. In 1994, for example, the bankruptcy of Orange County, Calif., shook financial markets, raising fears that bond investors would spurn local government borrowers. But Orange County's bondholders eventually got all of their money back, according to the rating agency Moody's.

One of Detroit's problems, though, is that its population and property values have plunged, shrinking the city's tax base.

Bond investors worry that if Detroit manages to pay them less than the full amount they're owed, it would set a precedent for other cities to follow.

"This fight could last for years," said Richard Larkin, director of research at Herbert J. Sims & Co. "Bond investors ain't going to sit back quietly."

Will it affect me?

Probably not, unless you worked for the city of Detroit or own its bonds.

Even if you blindly stashed most of your savings in muni-bond funds, it's unlikely that you loaned much to Detroit. Mutual funds tracked by the investor service Morningstar have $2.5 billion in bonds tied to the city. That's 0.003 percent of their muni-bond holdings, according to the Fed.

So I don't need to worry about losing my money?

Despite the high-profile problems of cities like Detroit, municipalities rarely miss an interest payment. The rating agency Moody's counted five defaults last year. Cities were behind three of them: Stockton, Calif., Oakdale, Calif. and Wenatchee, Wash.

Since the Great Recession hit in late 2007, a total of 26 municipal borrowers have defaulted on their debts, according to Moody's, and nearly all of them were hospitals and housing projects.

Corporations are much more likely to miss an interest payment. An average of 0.12 percent of all municipal borrowers default within 10 years, according to a Moody's study of defaults between 1970 and 2012. Nearly 12 percent of borrowers in the corporate bond market default over the same span.

How has the municipal market reacted to Detroit?

Interest rates on some bonds have crept up since the news broke, so some cities and towns will have to pay more to borrow from bond investors. Many investors, though, see Detroit as an isolated incident.

For the bond market to really freak out, said Schwartz, the former bond lawyer, "you're going to need a lot more Detroits."