Firstly, let's distinguish insecticide versus insect repellent. Insecticide is designed to kill bugs and is mainly found in products meant for your yard and such. Insect repellent keeps bugs from approaching us and is designed for us to use on our bodies. Insects are attracted to our bodies because we naturally produce carbon dioxide from our breath, pores, and sweat. This carbon dioxide is what insects are looking for in order to find food (a.k.a. blood for mosquitoes and ticks), which is why they sniff us out and attack us. Insect repellent masks the scent of carbon dioxide so insects can't find us. This is also why you might still find a mosquito on one small spot on your forehead or the back of your leg after applying bug spray, for example. If you miss one spot, they can smell that carbon dioxide and will bite you, which is why it's important to fully cover yourself with bug spray when applying. Insect repellent also generally comes with a strong smell that bugs hate, which further dissuades them from swarming.