On most small GA aircraft such as the well-known Cessna 172P "Skyhawk", the flaps are electrically actuated. Now - how do they stay at the setting selected by the pilot after extension ? Is there a bolt that is put into the flaps after the motor drove it to the selected position, and which is retracted again when a different flaps position is selected ? They surely aren't hold in place by the electric motor, because that would mean that the flaps would immediately be pushed back into the retracted position by air pressure in case of an electrical failure.
The total flap movement during extension is relatively small. This means there will be a significant gearing-down of the electric motor rotations between the motor shaft and the flap actuation axis. If this is accomplished with a worm gear drive it is possible to design the worm advance angle in such a manner that the friction normally present in the system will cause the gear drive to lock if it is being forced backwards. This allows the use of a relatively small electric motor to actuate the flaps and to make it impossible for the aerodynamic forces on the flap to spin the motor backwards through the worm drive and cause it to lose position.