The key underlying mechanism of most patterns in nature is self-organization. Each unit knows what to do, so a pattern emerges overall!
There is a bit of back-and-forth about exactly how many patterns are observed in nature, but the most common five seem to be spiral, meander, explosion, packing, and branching. Branching is exactly what nerves and trees do! Packing is similar to the beehive example, where nature tries to fit as much as possible into as little space as possible.
Spirals seem to be very common for organisms that grow throughout their lives, like certain molluscs and plants. Physicists think this is because spirals are one of the lowest-energy arrangements.