Here's the full story:
Steve Austin was eliminated from the 1997 Royal Rumble by Bret Hart, but the refs didn't see it. Austin snuck back in the match, and eliminated Undertaker, Vader and finally Bret to win the Rumble.
Bret then quit the company on a live Raw the next night, continuing to rant about always being screwed. To pacify him, a match was made at the February PPV between Austin and the three men he screwed at the Rumble. It would be a Final Four match, which was essentially a mini-Rumble where pinfalls and submissions also counted. The winner would go on to face the WWF champ at WrestleMania XIII.
Shawn Michaels, who was WWF champ at the time, gave the "losing my smile" speech a week and a half before Final Four, forfeiting the title. The Final Four match was then made for the vacant WWF title, and Sid, who was to have gotten a title shot at the PPV, would get a shot at the winner the following night on Raw.
The original plan was to have Austin win the Final Four match, then drop the title to Sid the next night. However, when Austin injured his knee during the match, they changed the finish on the fly, giving Bret the match and the title. He then lost the title to Sid the next night on Raw, as a result of interference by Austin.
They then made the Bret/Austin match for Mania, and since Undertaker was the last man left in the Final Four match, he received the title shot against Sid. The week before Mania, Bret got a title shot against Sid in a steel cage. He lost the match, despite interference on his behalf by Austin, who wanted to fight Bret for the title at Mania, due to interference by the Undertaker, who would've lost his title shot if Bret had won the title.
The rest, as they say, is history.