It's called haplodiploidy. Humans are diploid (need two chromosomes, usually X and Y), some species are haploid (only need one, and it gets weird from there) while ants/bees/wasps are haplodiploid (number, not type, determines sex).
So a queen lays two eggs: One egg is unfertilized and only has X, one is fertilized and therefore is XX. The X is male, because it is haploid. The XX is female, because it is diploid.
All this has the bizarre side effect that ant sisters are more closely related to each other than to their mother (assuming they have the same father- in fact, the number of males the queen mates with will affect how tolerant non-queens are of their fellow workers becoming fertile!)
Wow, I didn't know that was biologically possible. I was just telling my mother about your variety of knowledge, and I came across this. I told my mom, "uh oh. I think Humon might have been lax about her research this time." But then I looked it up, and you were right! Damn, you are GOOD!
No, they don't. Ant queens are really stupid compared to their peers as their cerebral ganglion is underdeveloped. They basically are just "birth machines" with huge ovaries and no brains. The worker ants work on their own, not on queen's orders, no matter how many ant queens live in a colony. So next time make sure that your metaphors aren't so completely off.