Those insects are attracted to easily accessible food. Maybe they moved from neighboring houses or were brought with stuff, furniture, and products. It is much easier to prevent the appearance of ants than fighting them. But if those little guys already visited your apartment you should read these
hacks about how to get rid of them. Hope it will come in handy for you.