This is always a fascinating topic, you have hit the major points here, I would like to add a couple of details to this which may provide a bit more insight into the reasons it happens.
Because the motor is suspended on the axle on one side (by support bearings with a relatively tight clearance) and on the nose support on the other side of its case, it is following the rail profile and gets hit with impact loading almost as high as the wheel and axle. The truck spring suspension does not help cushion the motor at all, as it is between the journal box and the truck frame. Consequently it is not unusual for the traction motor to see impact loadings in the 17G to 20G range. This not only effects the brushes and brush holders, it also shakes the armature within the bearings that support it inside the motor housing, which also causes the brushes to move in the brush holders. If any of the brushes draw an arc during this beating, it can ionize the air around the brush, and once the air becomes conductive you can create a path to directly short the electrical potential across the motor, either brush holder to brush holder (usually last stage of a really bad flashover as FDL4ever noted) or by going through the adjacent motor structure (which is a much shorter path), just as Nick pointed out.
Years ago EMD did a high speed camera film of traction motor flashovers, and they used to show it in their training center. It explained the reasons it happened, and pointed out the effects of various contributing factors. It was extremely spectacular, it is amazing how much damage can be done in an instant.