a few reasons could be
1. you're going slow so flash to pass
2. they could think your highbeams are on because your lights are naturally bright..
3. admire your car, i sometimes give a thumbsup like this
4. giving you the right of way or saying go
5. your lights are off
6. warn you of a danger ahead, car wreck, animals, stopped traffic, speed traps..
7. if you make a jerk move, or driving like an asshat, they're "getting back" at you (not saying OP, just in general)