Why do ants eat bugs?
Ants evolved from earlier wasps about 150 million years ago, around the same time that mammals were beginning to become common. Some wasps lost their wings and couldn't fly anymore, and some of those evolved into ants (though a few kinds of ants can still fly a little, and some wasps can't fly). Some ants have even lost their eyes because they live underground and don't use them.
But soon ants had predators of their own: birds, which evolved to be able to eat ants.
Bibliography and further reading: