Ant granules work by attracting ants to the bait, which they carry back to their colony. Once there, the bait is shared among the ants, including the queen, leading to the gradual elimination of the entire nest. This method ensures comprehensive control over the ant population, targeting the root of the problem.