How do municipal bonds differ from Treasury and corporate bonds for a regular investor?
The big difference is taxes. Municipal bonds ('munis') are issued by state and local governments, and their interest is generally exempt from federal income tax, and often from state tax too if you live in the issuing state. Treasury interest is federally taxable but state-tax-exempt, while corporate bond interest is fully taxable at both levels.
That tax break makes munis most attractive to investors in higher tax brackets holding bonds in a taxable account; the lower headline yield can beat a taxable bond after taxes. To compare fairly, calculate the 'tax-equivalent yield.' Munis are less useful inside a 401(k) or IRA, where all growth is already tax-sheltered, so you'd be giving up yield for a tax break you don't need. Credit quality varies by issuer, so most investors get munis through a diversified fund rather than picking individual bonds.