Ants are commonly known to tend Homopterans, such as aphids, scales, etc.
But what is this ugly thing?
Obviously it is attractive to ants. (I know, the photos aren't the greatest).
Here's another kind.
Wow, that one is popular.
The plants these structures are on are oaks (Quercus). I believe they are Emory Oaks, but please let me know if they aren't.
The reddish-brown structures are galls caused by cynipid wasps. There are a number of species that cause galls on oak trees, in particular.
The galls of some species secrete a sweet substance that is attractive to ants.
This one is a bit puzzling because the presence of ants are thought to protect against predators and parasites, but what could attack a gall wasp hidden inside a gall? Wouldn't that plant tissue disguise and protect it?
It turns out that there are parasites that can kill gall wasps. In fact, scientists have shown via exclusion tests (by preventing ants from reaching galls), that survivorship of certain gall wasps is significantly increased when tending ants are present.
Security, and the gall wasps don't even have to supply the payment. Now that's sweet.
T. F. SEIBERT (1993). A nectar-secreting gall wasp and ant mutualism: selection and counter-selection shaping gall wasp phenology, fecundity and persistence. Ecological Entomology. 18(3): 247-253.