A locknut (lock nut or locking nut) is a nut that is used to stop some other nut or similar component from working loose for example at a certain frequency of vibrations.
A thin nut is first tightened down and a normal nut is screwed down on top of it. The thin nut is then slackened back, thus wedging the nut threads against opposite flanks of the bolt threads. This jams the nut in place.
Locknuts are also used when some part of a machine spins as they can allow the transmission of rotational force (torque) to a threaded axle: in the context of power transmission, locknuts are used to securely fasten gears and bearings to shafts or spindles.