Ultimately, the function really depends on how it's used in the context, but here's a general list of some of the functions that they can serve from the top of my head.
Anaphoric (where the pronoun occurs after the referent):
+Creates links through the text by making readers (or listeners) figure out which pronoun refers to what, thus creating cohesion
+Economises word usage and adds fluency
+Can be used effectively in parallelism (but then again, this is VERY dependent on the context)
Cataphoric (where the pronoun occurs before the referent):
+Referent provides clarification (so often used in spontaneous interactions)
+Because of the prevalence of this in spontaneous interactions, can create an informal register
+Can build up a sense of anticipation if the pronoun is used copiously before the referent