What I remember:
In the 1997 US OPEN, Sampras lost to Korda in R16 in an extremely close match ( 6-7 7-5 7-6 3-6 7-6 ) and Rafter won the tournament (against Rusedski in the final), his first GS title.
At that point in time their head-to-head was something like 8-1 for Sampras (Rafter winning their very first match, IIRC). Few days after the tournament Sampras said that that loss to Korda was painful (Korda playing out of his mind as he usually did twice or thrice every year) because he was playing good tennis that year and that had he defeated Korda in that very close match, he felt he would have won the tournament.
Possibly Rafter didn't like that comment. Then came the "fart" incident.
After the 1995 Davis Cup final in Russia where Sampras won the three matches that he played, defeating Chesnokov and Kafelnikov on a watered down clay, he very rarely put a big effort in Davis Cup matches anymore, but in 1997 few weeks AFTER that USOPEN, USA played against Australia in the Davis Cup SF, on outdoor hardcourts, and Sampras wanted to play to show Rafter (and the rest of the world) who the nº1 player in the world really was.
Sampras defeated Rafter 6-7 6-1 6-1 6-4 showing an amazing level in large parts of the match (and then defeated Philippoussis 6-1 6-2 7-6 playing extremely well again).
Shortly after, he faced Rafter again in the final of the (then) very prestigious Grand Slam Cup and Sampras won again by 6-2 6-4 7-5 (the way Sampras returned serve and hit passing-shots in these matches.....was top level Sampras).
They faced each other again in The Masters (now called WTF) and Sampras won again 6-4 6-1 (eleventh consecutive victory for Sampras in their head-to-head). It seemed Sampras wanted badly to tell the whole world that he would have destroyed Rafter had he been able to play against him in that USOPEN final (had he NOT lost to Korda in that amazingly close match).
Then, in 1998 they faced each other in the Cincinnatti final. As someone said above, Sampras was just destroying Rafter, hitting perfect returns-of-serve and perfect passing-shots both from the forehand and the backhand side, winning the first set by 6-1. During the second set, I think Sampras was one break ahead but then lost it, and then at 4-4 he had a break-point, but Rafter made a second-serve ace that Sampras let the ball pass by, he thought it was out, but said nothing in that moment.
Then they went to a tie-break and Rafter won the second set. The crowd was clearly behind Rafter and Sampras was kind of pissed because of that. Suddenly a match that was clearly his, was now an open battle against a relentless warrior with the crowd (American crowd) behind. To top it all, the match was decided on a very controversial ace by Rafter (very similar to the ace he made to save that break-point at the end of the second set) and Sampras at that moment was clearly losing it.
After that match I think it was when he said "the difference between us is 10 GS titles" when asked. He possibly thought he was clearly commanding that match and only lost it because of "random adverse factors" (bad luck, controversial calls, shame crowd,....,whatever
).
Then of course came the 1998 US OPEN and they faced in the SF. This was a very close match. Sampras was winning two sets to one, when he injured his leg. He continued playing but ended up losing the fourth and fifth sets.
Rafter defeated Philippoussis in the final (winning his second US OPEN) and then Sampras said "When I see him holding the US Open trophy, it pisses me off", implying that had he not got injured at the end of the third set, nobody would have stopped him and that title would have been his.
Even if possibly right, you cannot say that. It is very disrespectful both to Rafter and Philippoussis, and Sampras looked like a sour loser and everybody was at the time kind of surprised because of this sudden strange behavior of Pete.
Pete and Rafter talked by phone later on and cleared things out, and Sampras never lost to Rafter again.