To solve the puzzle, the team examined the digestive tracts of wombats that had to be euthanized following vehicle collisions in Tasmania, Australia.

The wombat takes about two weeks to digest its food and researchers found that as faeces move into the final 8% of the intestine, it changes from a liquid-like state into solid matter. At that stage the dung takes on the shape of separated cubes measuring about two centimeters in length.

By inflating the intestine with a long balloon, the researchers found that the wombats’ intestine walls stretch unevenly, allowing for the formation of the cube shapes.