In the case of a duly noted fall, puncture or mechanical incident in the last three kilometres of a road race stage, the rider or riders involved shall be credited with the time of the rider or riders in whose company they were riding at the moment of the accident.
His or their placing shall be determined by the order in which he or they actually cross the finishing line.
In simplified terms, under this UCI rule 2.6.026., If a rider suffers a mechanical or crashes within the final 3,000 metres of the stage, then they will be awarded the same time as the rider, or riders, they were with at the time of the incident.
The rule exists for safety reasons. If riders know they could lose time in the closing moments of a race because someone brings them down, they might fight to stay up front, causing more pressure and thus increasing the chance of a crash.
Instead with the rule a ride can role past the 3km sign and know that so long as they keep on the wheel in front then they’re safe from being penalised for an accident. But if the sit up and let a gap appear, then of course they lose time. It is an artificial construct but I tend to think it works and 3km to go is probably about the right place.