Hi, yes, those fruit flies are annoying but quite simple to get rid of. What they can smell is ripe or very ripe fruit, they can smell it from miles away. With the heat, the fruit ripens very quickly and the riper it is the more it smells. If it is almost starting to rot the flies go mad! It doesn't matter if it is fruit or potatoes or onions, anything organic basically, but the sweetness of fruit is particularly attractive. They arrive, lay their eggs and before you know it you have a swarm and they will live for about 30 days. It is even possible to have eggs on the fruit and veg when you bring them back from the supermarket.
Steps to avoid them - wash all fruit and veg you buy from the supermarket and don't keep them in fruit bowls or baskets. Keep everything in the fridge. Make sure you have no rubbish in the kitchen overnight. That should do the trick. (Once you have them they look for damp, warm areas which may be why you are getting them neat your bath...)