An underwriter is someone who takes a financial risk (relieving another party of it) in return for a fee.
The most familiar underwriters are insurance companies, whose entire business is the underwriting of a wide range of risk.
Some new issues, most importantly IPOs, of securities are underwritten, usually by investment banks. The underwriter agrees to buy any securities that unwanted by the market. If the offer is not as successful as expected the underwriter may make a loss.
The underwriter does not usually take as large a risk as may appear. New issues, especially large ones, are priced low enough to make it likely that the issue will be fully subscribed. This is why stags usually make a gain on IPOs.
The underwriter of an issue of a security may be a single investment bank or, especially in the case of a large IPO, a syndicate of banks.
Underwriting is very lucrative, and there has been a long running controversy over whether this is an indication that investment banks are colluding on pricing.