This story appears in the May 2011 issue of National Geographic magazine.

If aliens ever do land on Earth, don’t get all huffy if their greeting turns out to be: "Take me to your ant."

That ant might be a queen mother, weighing about the same as a few grains of salt. But she, along with other queens and their worldwide empires, would match the weight of the seven billion people seething across the planet these days. Plus, the queens and their offspring have been living in large, highly organized, cooperative societies—practicing activities from strategic army warfare to agriculture and livestock herding—for at least 50 million years. We've been at it for, what, 10,000, tops?

I'd nominate entomologist and photographer Mark Moffett as the aliens' escort. During years of jungle quests he has discovered new ant species and astonishing ant behaviors. Even over breakfast here in the rain forest of Queensland, Australia, he's pondering what sort of organism an ant colony amounts to, since it is this social group as a whole, not the individual, that really competes in the struggle for survival and evolves over time. Consider the colony as a unified body in which individual members are like cells, with castes of them performing separate duties like specialized organs.

Just above our heads, in the rain forest canopy, streams the almost perfect society. In other tropical and subtropical woodlands, scores of different ant species may share a single tree. But there's little room for coexistence where the ants known as Oecophylla make their home—one species here in Australia and in southern Asia, the other in parts of Africa. Long-legged and lithe, they so aggressively dominate huge territories in the forest canopies that locals simply call them the tree ants.

Or weaver ants, because they make their soccer-ball-size nests among the branches by sewing leaves together. Each weaver ant colony inhabits from half a dozen to more than a hundred nests at any given time, forming a metropolis of boroughs and suburbs connected by busy commuter routes. A hierarchy of workers and soldiers maintains and defends this territory, which spreads from treetops to the forest floor, staying in sync through constant communication. They touch each other with mouths, forelegs, or antennae. They lay down scents with different glands to send different messages. They release more pheromones into the air to broadcast signals quickly and widely. They even display symbolic behavior: To warn of an approaching enemy, for instance, they jerk their bodies in a kind of ritualized fight.

Weaver Ants... On the Menu Mark "Dr. Bugs" Moffett samples the local delicacy in Angkor Wat, Cambodia.

Scientists have likened weaver ant communication to a type of language with primitive syntax. Urban planners examine the organization of ant societies. Mathematicians draw upon analyses of ant behavior to devise parallel computing formulas (where multiple problems are solved simultaneously). Ants serve as models in all kinds of studies aimed at figuring out how big, complex jobs get done with small parts and a minimum of instructions.

Here is how a weaver ant nest-construction project gets under way.

A single worker stands on a leaf and reaches to grasp the edge of another leaf nearby. If the span is too great, a second worker climbs over the first, and the bottom ant grasps the newcomer by its wire-thin waist and holds it out closer to the goal. Still not enough? A third ant clambers over the first two and is lifted out farther yet. Ant by ant, a living chain grows into thin air like the arm of a construction crane. Once the distant leaf is grabbed, the squad pulls in unison, often with nest mates that have formed parallel chains and reinforcing cross-links, to draw the leaves' edges together. Workers begin to array themselves like live staples along the seam between the leaves, legs holding on to one edge, jaws gripping the other. And then? They wait.

As evening comes on and the humidity rises, more workers arrive from nearby nests. They're carrying larvae that are about to enter the pupal stage and metamorphose into adults.

Larvae of other ant species spin individual protective cocoons of silk. Oecophyllalarvae donate their silk to the colony. Straddling the leaf seam, an adult uses its antennae to tap the head of the larva held in its jaws, telling it to extrude silk from its salivary glands. A worker's operating manual would read: Swing head to one side. Tappity-tap larva. Dab glob of its silk onto leaf. Swing head opposite way, drawing thread across to other leaf. Keep tappity-tapping larva. Dab next glob there. Step forward. Repeat procedure. When finished, move on to other tasks.

If you're close enough to witness this use of juveniles as sewing tools, some workers are probably going to be biting you, having caught your motion with their keen eyes, sensed the odors in your breath, or felt movement when you brushed a branch. When you're really close, an agitated throng coats the nearest plant parts like bristling fur, each ant lifting its body high on four legs, raising its gaster—the largest and hindmost segment of its body—up (sometimes vibrating it), a posture that signals excitement. The two front legs flail forward; they can hardly wait to grab you. The sharp-tipped, curving jaws are cocked open, poised to pincer, puncture, and inject some glandular concoction that adds extra hurt; it may make you woozy as the number of bites adds up.

Meanwhile the troops are spraying formic acid, which burns the nostrils like a whiff of ammonia. They're also releasing alarm pheromones, from that upraised rear end as well as those formidable jaws, while other workers race off to contact nest mates directly, establishing scent trails along the way to guide them toward the threat. Give the recruiters a few minutes, and thousands may be streaming in your direction. Don't linger. The population of some colonies exceeds half a million.

In one of the completed nests a queen, many times the size of typical workers (called majors and minors), is pumping out eggs. When the larvae hatch from the eggs, some of the workers feed and clean them and transport a portion of them to nurseries in other nests. Every so often a large batch of reproductive females and males is produced. They sprout wings and fly off to mate, and the fertilized females may start new colonies. The rest of the time, the queen's offspring all become nonbreeding females—a fierce sisterhood of near clones that patrol their colony's territory, search out and collect food, and grapple with any invader, no matter how big, no matter how deadly, in service to her majesty and the survival of the colony as a whole.

A queen may live years, the average worker maybe months, Moffett says, adding: "Any major that actually dies of old age hasn't been doing its job for the colony." Two of the scientists he worked with when he was a graduate student at Harvard University, leading ant experts Bert Hölldobler and Edward O. Wilson, found that the oldest workers end up in barrack nests near the front lines of a colony's territory; they're the most likely to encounter enemies and fall in battle. "A principal difference between human beings and ants," those researchers have written, "is that whereas we send our young men to war, they send their old ladies."

Somewhere off in the black rain forest night, Moffett is singing nonsense jingles interrupted by little squeaks and hmmms. It means he's trying to keep focused while being bitten. When I find him, he's peeling back silk-hemmed leaves to peer at the inner workings of a nest, and defenders are swarming his arms, sprinting toward his bare neck.

Mapping out colonies in an orchard at the forest's edge the following morning, we find one that encompasses 17 trees. "Compared with a continuous ground surface, treetops aren't able to support many heavy-bodied animals," Moffett says. "Plenty of territory to roam up there, but it's mainly leaves. So if you're a predator, the best way to control a large territory in the canopy is to be small yourself but abundant enough to reach all those little surfaces. Think of a colony as a single critter spreading itself through the trees as a thin film."

As predators, weaver ants hunt practically every kind of invertebrate big enough for a meal—and so effectively that the ants' territories become patches where many creatures can exist only at low populations, if at all. Chinese farmers noticed this 1,700 years ago and placed nests in orchards to safeguard fruit, making Oecophylla the oldest known form of bio­control. Lately ecologists have been promoting it in Africa as a safe, effective, and inexpensive alternative to pesticide sprays. The poorest farmer can run strings from a weaver ant nest to fruit trees, and legions of female warriors will tirelessly eliminate fruit flies, caterpillars, and other potential pests for free.

As soon as a major latches on to prey, another maneuvers to grab and pull a leg or antenna. Within moments, half a dozen or more majors will have the victim—be it soft-winged moth, scout from a foreign ant colony, or burly scorpion—spread-eagled, stretched beyond its limits, and about to be ripped apart. A couple more sisters gnaw at weak points to hasten the job. Holding the pieces aloft, workers join the river of ants flowing back toward a nest laden with prizes from other hunts. The heaviest chunks are carried by groups that somehow keep coordinated, even as some team members leave and new workers join in.

All the while, different platoons are out tending scale insects and other homopterans (sucking insects that feed on plant juices). The shepherds physically carry this livestock to prime pastures, guard the herds vigilantly from enemies, and gather special droplets of sugar-rich syrup, known as honeydew, that the bugs excrete. Like every bounty, it is then carried off to be shared with nest mates—added to the communal gut.

Even the stodgiest scientists are growing more comfortable with the notion of the ant colony as a superorganism. Moffett's musings lean further out. He keeps trying to explain to me how weaver ants operate in an Einsteinian universe where space bends and warps. Mentally shrink yourself to ant size and set out walking on a leaf. It's a two-dimensional plane, except that it curves and twists and after a while suddenly falls off into thin air. No matter, you just climb over the edge and keep walking on the underside, then wend your way down a stem to another curling green surface.

"Weaver ants weigh so little, they're scarcely affected by gravity," Moffett says. "The rocking of branches in the wind is a stronger force to them, so they often don't know which way is down. But if an ant wants to go from one tree to the next, there's a huge gap relative to its size. It might have to travel all the way to the ground, back up again, and then out on another branch. What Oecophylla often does, though, is get a bunch of buddies together to form an air bridge and cross directly to the other side."