In online gaming, a lag is a noticeable delay between the action of players and the reaction of the server.
This leads to unexpected teleports, so players aren't actually where they see themselves. Due to that, unintended and unexpected crashes into e.g. walls or other karts can happen and a player loses time and maybe even the race because of this. Lags are especially unwanted on Ranked or in any other kind of competetive gaming.
Lags appear particularly when having a high ping which means being far away from the server. However, the ping is not the deciding factor; jitter (also known as packet loss) has bigger influence on lag. For example, if the packets are not lost, a player can have a relatively good gaming experience while being on the other side of the globe, but if the connection is unstable even the nearby servers can produce lags for a player.
Note that wireless networks cause more packets to be lost, which means cable connection is recommended, especially for ranked races or popular competitions.