Drop out the ability part. Let's focus on a pure luck scenario: Take 2 dice (2d6) and roll them. You get a 12. What is more probable on your next roll? Another 12 or a 7?
With regard to the race, if you do really well, much better than your average, without any fundamental change to your ability that's the same as rolling a 12. It's an unlikely (though possible) event that happened to occur. Over a series of races, however, we would not anticipate a repeat of that performance (that is, it's a low probability event, and a series of such low probability events has even lower probability).
The gambler's fallacy goes the other way. It's the belief that if we've had a string of bad luck [0], then we should wager on good luck being around the corner. That is, the gambler assumes a low probability event is "inevitable" after a series of high probability events. Regression to the mean: A high probability event should be anticipated after a low probability event.
[0] In gambling this usually means getting close to the average, that is: the average hand is the lowest valued hand, the rarest hand is the highest valued. So a gambler making this fallacy would wager on seeing a royal flush after several hundred hands of only seeing pairs.