Ants form complex underground colonies through a process of organization and teamwork. Each ant has a specific role within the colony, such as foraging, caring for the young, defending the nest, or reproducing. By working together and communicating through pheromones, vibrations, and touch, ants are able to construct intricate tunnels, chambers, and storage areas underground. This division of labor and coordination allows ants to create and maintain their elaborate underground colonies efficiently.