A MarketMaker is a Broker/Dealer operating on a stock exchange (usually electronic; the NYSE has specialists to fulfil this function) whom holds a certain number of shares in an instrument in order to facilitate orders in the equity; the MarketMaker competes with other MM's in their instruments for business, offering a bid/ask spread for a guaranteed number of shares that can be bought or sold.
When a price is quoted, a MarketMaker is obligated to buy/sell a minimum of 1000 shares at that specified price, after this, they are then allowed to modify their prices in order to make a profit on the trading they have done; hence it is in the interests of the Market maker to be involved in as many trades as possible in order to profit as much as possible, although usually the MM prefers to make the spread (the equivalent of buying at the bid and selling at the ask).
A Marketmaker is obligated to provide each client with the best price that they can, hence preventing them from filling market orders at a price they choose; effectively chopping a buy/seller of a better deal.
MarketMakers also receive commissions for doing business with their firms and hence also strive to provide liquidity in the instrument.
A MarketMaker is also permitted to legally take a naked short position (the act of lending shares to the market without selling real, borrowed shares as is normally done), meaning that during high demand, a Marketmaker may be naked short at times of the day, however, some claim that this may also be exploited by MM's to drive prices down.