To overcome obstacles and survive harsh environments, fire ants link their bodies together to form self-assemblages such as rafts, bridges and bivouacs. Such structures are examples of self-assembling and self-healing materials, as ants can quickly create and break links with one another in response to changes in their environment. Because ants are opaque, the arrangement of the ants within these three-dimensional networks was previously unknown. In this experimental study, we applied micro-scale computed tomography, or micro-CT, to visualize the connectivity, arrangement and orientation of ants within an assemblage. We identified active and geometric mechanisms that ants use to obtain favorable packing properties with respect to well-studied packing of inert objects such as cylinders. Ants use their legs to push against their neighbors, doubling their spacing relative to random packing of cylinders. These legs also permit active control of their orientation, an ability ants use to arrange themselves perpendicularly rather than in parallel. Lastly, we found an important role of ant polymorphism in promoting self-aggregation: a large distribution of ant sizes permits small ants to fit between the legs of larger ants, a phenomenon that increases the number of average connections per ant. These combined mechanisms lead to low packing fraction and high connectivity, which increase raft buoyancy and strength during flash floods.