Ants have a common ancestor with wasps, but the social wasps are quite far away from ants. Ants are more related to bees. There are many groups of parasitoid wasps in between that have no social behaviour or colonies at all, so it is wrong to say that the three main eusocial groups of hymenopterans (social wasps, bees and ants) are coming from the same ancestor that already displayed this colony behavior.

That said, it might be that because they are still somehow related, they share genetic materials that lead to eusociality forming more easiliy in that group, but there is still much research going on.