Some washing machines actually measure how dirty the drain water is to decide whether to do another pass with fresh water. Since this is a dynamic decision, the remaining time cannot be accurately predicted in advance.
(Not saying this is true for all, some might just lie outright).
A big factor of uncertainty at the end of the cycle is the weight distribution for spinning.
Newer washing machines rotate the drum slowly until the clothes separate, bringing the centre of mass closer to the axis of rotation, leading to much less vibration during the spin cycle. If the weight does not distribute after n cycles (e.g. if you put a single large and heavy duvet cover inside), some lower the spin RPM to a level that is deemed acceptable.
I've always assumed that they perform this measurement via the current curve of the motor during a rotation. Flattened curve -> distributed load, CG close to spin axis. Huge spike -> offset load, CG far away from spin axis -> bang bang bang walking washing machine.
(Not saying this is true for all, some might just lie outright).