Mix 1 to 1 parts Baking soda and confectioners sugar. place a bit, ( a teaspoon or two), in can lids and set them in the center of the ant activity.
When ants take the sugar they will get some of the baking soda too. The baking soda produces gas in their systems. Ants can not fart so the gas builds up and they explode.
Simple, easy and inexpensive.
Ants are in the family Formicidae. If you smash one, you can smell the Formic acid that they get their name from. The baking soda is a base.
You are giving them a acid/base reaction.