Bees can be extremely intelligent. Not only do they learn how to overcome obstacles by doing, but they can actually learn by watching others as well. Bees are also brilliant mathematicians. Bees perform a waggle dance which utilizes speed and directionality to communicate the location of resources relative to their current position and the Sun. Over their evolutionary history, they have mastered the art of storing the most amount of honey while using the least amount of resources. The secret behind this efficient honeycomb is due to its hexagonal shape.
Creating beeswax is a fairly expensive process for the bee, as they consume eight ounces of honey for every one ounce of wax they create. For this reason, they need to make sure that they aren’t wasting resources when creating the structures that will house nectar and honey. The secret is in the geometry of the structures.
Check out this TED-ed video by Zack Patterson and Andy Peterson that explores why the hexagon is the perfect shape for bees, and why circles, triangles, or squares just would not do: