If you buy a muni in the state where you live, you can avoid state as well as federal income tax. That is a bigger advantage if you're in the higher tax brackets, because it means you get to avoid more tax. In general, munis have a good safety record, but if you want to be sure, you can buy bonds insured against default. Current yields are around 4 percent. A muni bond fund or trust is a better way to go if you have a small amount of money.
Yield is determined by credit rating of company.
You collect the interest paid by homeowners. Yields today are about 7-8 percent. Very secure against default by homeowners because Ginnie, Freddie and Fannie guarantee repayment of principal. The problem is that when rates fall, like now, homeowners refinance their mortgages. If you hold these securities, you get back a windfall of principal and can't reinvest it at high interest rates.