These changes are the result of the combination of several factors.
A high number of competitors
The sea is covered with boats that constantly overtake each other. You may lose or win a large number of places when in reality your speed compared to other competitors has fluctuated only slightly.
Your ranking is not refreshed constantly
The information you see on your computer or tablet screen regarding other competitors is not updated in real time. This includes the position of the other competitors on the map, but also their position in the rankings and the distance that separates you from them.
If you could see this information in real time, your internet connection would be saturated by the amount of data received. To avoid this, the server instead sends you data that is periodically updated.
For this reason, when you look at your ranking every 20 or 30 seconds, for instance, you get the impression that other boats are jumping up and down in the rankings, and that the distance between you and them changes much more than it should. When you check your ranking every 5 or 10 minutes, you do not notice these fluctuations.
How can the game tell who is first or second?
As far as the server is concerned, everything is happening in real time. This real-time information is what we use to tell who crosses the finish line first, even for competitors who are only a split second apart.