When I started driving in New York State (albeit many many years ago), it was actually legally required to honk at a cyclist as you approach them. Don't know if it's still the law or if any other states do this. As people above have said, sometimes it's a courtesy honk much like some cyclists ring a bell on a MUP. I don't think pedestrians look at a bell as a signal that they shouldn't be on the path.
Sometimes I'll tap my horn as a warning or courtesy if the space is tight or the road is winding. I'd be concerned if the honk was accompanied by shouting or throwing things.