Insects are complex and different in how they process information. Ants are smart for insects, but still not fully individuals in the same way we look at mammals or other animals.
https://wildlifeinformer.com/do-ants-have-brains/
The simple answer is thoughts are pheromones. Essentially one ant shares it's individual experiences with the entire colony and the colony all works for the same goals. So yeah they kinda connect to the colony organic wifi by releasing the same chemicals that other animals do but the chemicals are shared.
So one feels rewarded, the rest do and that leads to them working together. This is why if you piss one off, they all attack because that chemical is shared with the colony and all of them become aggressive.
Also a vast majority of insects are born with all the basic functions and skills of an adult. They come out knowing exactly what to do and how. There really is no "learning", the colony learns the individual shares that knowledge.
So every new ant pops out fully functional and basically downloads the rest from the colony to know where found food/water sources are if they are collectors. If they are soldiers they instantly get in line to protect the hive and know the layout.