Hex Nut is 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 being rounded off.