They are used to:
notify users of something happening (a new comment/post/activity somewhere).
retrieve informations, photos and other stuff from sites, blogs, search engines etc..
store informations (there are bots that can store secrets for example)
anything you program them to do.