Party A buys 500 MSFT shares from partner B today, and then immediately sells them at the current market price to C. Depending on the terms of the deal, party A must pay back the same number of shares at a later date to party B. Let's say 30 days later, party A rebuys 500 shares of MSFT at THAT current market rate (hoping it has decreased over the last 30 days), and repays the same number of shares (hoping it's a smaller $ value) to party B.
The people lending the short are expecting the stock to go up, the people buying are expecting it to go down.
Hope that helps