In the European wood ants, Formica rufa, which is a very well studied species, it is pretty much known what they do.
Many other species are not as well studied.
In Formica rufa, the first eggs laid by the queen in spring are all male.
Reason: the queen can control the valve to the spermatheca, where she stores the sperm to make females (queen alates and workers).
However, if it is too cool, then the queen cannot open the valve and so all eggs laid will be males.
As soon as it is warm enough, the queen will produce females, however, wild ants are on a certain timetable and the queen has to decide what to do with these females- worker or alate?
Turns out- as soon as the queen can open that valve to allow precious sperm towards her eggs, she will do so and also lay eggs with extra yolk and nutrients so the first steps towards a queen alate are made.
Alate larvae will also be provided with a heady brew of hormones and pheromones and they will receive a larger amount of food.
When this is done and the sexual reproduction for the year is planned and set in motion, the queen now settles down to run the day to day business of the nest, with the production of the workforce.
Eggs laid by the queen in summer will become workers. These eggs have less yolk and provide less nutrition for the developing embryo, so smaller workers are born.
Formica rufa does not overwinter with development stages, so there are no larvae or pupa in the nest during winter. This is different from Camponotus, for example, which have larvae in the nest during winter which are in arrested development- meaning, the larva won't grow during winter. I made the same observation with my Temnothorax, which also hibernate with their larva (and I can now, in spring, see that some of these larva are huge and will become queen alates in summer, check out my Temnothorax journal).
Ant reproduction is very fascinating, there are many different ways of doing things, army ants for example do the thing that bees do with splitting their hives when a new queen is ready to take over- then the old queen takes half of the worker population and moves in a different location. The princess meanwhile is sitting in the old army ant swarm waiting for the boys to arrive (which are also called "sausage flies" and since they have only one duty in life, E.O. Wilson called them "Sperm Missiles"). When the boys arrive, the workers will rip their wings off and then place them next to the princess, where they do their thing, and when they are finished and the next suitor comes along, the now empty sperm missile is killed and eaten.
Some species of ants, like Messor barbarus, need to mate with several males of different genotypes to produce valid colonies, other species only mate once.
A lot of differences and variations.
There are even a few clonal species, like the invasive Wasmannia auripunctata. They are parthenogenetic- meaning, they can reproduce asexually and produce female clones from haploid eggs! This species is extremely fascinating. It is one of the only animal species on the planet where there exists a female and a male clonal line- meaning, it is possible to find males and females in a nest with totally different genotypes.
While they can clone each other, if necessary, they can also revert back to sexual reproduction.