Does salt absorb moisture?
Your ant problem was caused by moisture in that windowsill. They were coming to drink. You gave them salt. In biological beings, salt causes water retention, and makes them thirsty. Too much salt kills. Now you’re seeing moisture in the window sill because the window was originally flawed to let water in. That’s why the ants came. I hope this is a coherent explanation.