If one variable is written as a function of another, this means there is a relationship between the two variables.
There will be a relationship between the time it takes to finish a race and the distance of the race. The longer the distance of a race is, the more time it will take to finish it. Therefore the time can be written as a function of the distance.