A nut is a type of
hardware fastener with a
threaded hole. Nuts are almost always used opposite a mating
bolt to fasten a stack of parts together. The two partners are kept together by a combination of their threads' friction, a slight stretch of the bolt, and compression of the parts. In applications where vibration or rotation may work a nut loose, adhesives, safety pins, and other tricks are used to prevent fastener rotation. The most common shape is
hexagonal, for similar reasons as the bolt head - 6 sides give a good granularity of angles for a tool to approach from (good in tight spots), but more (and smaller) corners would be vulnerable to stripping/rounding. Other specialized shapes exist for certain needs, such as wing nuts for finger adjustment and captive nuts for inaccessible areas.
See more at Wikipedia.org...