Why do you sometimes see sparks on the catenaries?

This phenomenon is part of the normal functioning of the train, causing only very minor wear
to material and presenting no risk for passengers. How can it be explained?

Why do you sometimes see sparks on the catenaries?