What's a deviation in cycling
Sprinting is stressful. Sprinters may not have to work as long or as hard as climbers, but in those seconds close to the finish line, so much can go wrong. Crashes aren't a given, but they're also not unlikely. To reduce the likelihood of these crashes, the UCI has implemented a rule where a rider cannot deviate from their sprinting line during their sprint. Specifically they cannot:
Deviate from the chosen line that obstructs or endangers another rider or irregular sprint (including pulling the jersey or saddle of another rider, intimidation or threat, blow from the head, knee, elbow, shoulder, hand, etc.).
In non legalese the term "deviate" generally refers to the rider moving left or right from the initial forward path of movement they have taken. This is to avoid crashing (or "chopping") into another sprinter who is also sprinting for the finish line. But also as a fairness tactic for those riders who don't want to crash.
Imagine a rider, say rider A, who always deviated because he knew another sprinter, rider B, who rider A was moving into would give way (because rider B has more brain cells 🙃). This would almost guarantee that rider A would win every sprint and wouldn't be much fun.
It's similar to how in track and field, for the sprinter's races (60-400m) runners must stay within the bounds of their lane.
It's also why a good lead out train is so important. If you can get the best line going into the sprint, you're that much more likely to win it. Unlike on the running track, all lanes aren't created equal in a cycling finish.
Deviation rules aren't always enforced. It's up to the race commissaires. It's quite often that sprinters will get away with deviations unless a team complains or the rider is known to be a constant deviator.
We find it's a bit like charging fouls in basketball. Where big names often get lenient calls in their favour when it comes to charging. If Wout van Aert deviates, he's less likely to get called for it then someone less well loved in the peloton.
If the deviation rule is enforced, UCI points can be deducted, fines applied, or relegation or disqualification can occur. Relegation refers to giving the rider who has broken the rules the time of the last rider in their group. So if there was three riders sprinting for the finish line and one deviated and got relegated - they'd automatically finish third regardless of what place they came in the sprint. Given the chance of the deviation rule not getting enforced, deviation isn't always a tactic ignored by the less reputable sprinters.