They are cleaning themselves.
Flies smell and taste through their feet and every time they land (technically, that’s what they do half of the time) they get their feet dirty. The rubbing is their way of blowing their nose and brushing their teeth so they can smell/taste whatever it is they are standing upon.
Latest Answers