The reproductive cycle of ants is quite fascinating, to be honest. Female ants (workers and queens) come from fertilized eggs, while males come from unfertilized eggs. The queen can choose which type to lay, depending on the size and health of the colony.
For ants which do not take slaves and maybe some other exceptions, the workers actually have more power than the queen and "farm" her for their benefit. The queen tries to undermine the workers by mating with more than one drone to reduce the relatedness between workers.
For ant species which take slaves, since the workers are the wrong species, they are busy trying to influence or control the wrong species of queen.
For a long time the eusocial nature of ants and other hymenoptera was evidence that Darwinian evolution was wrong, but once the secret of their sex determination was figured out, they became the exception which further proved that it was correct. Their behavior is a result of the females being more closely related to each other, 75% in the simple case, than their own children, 50%, if they had them.