Se as the third person reflexive pronoun comes from the Latin reflexive pronoun, which was se in the accusative case and sibi in the dative case (later merged). So se as a reflexive mark is the oldest usage.
Reciprocal use of se is a natural extension of its reflexive meaning. Note that in Spanish there isn't a simple way to mark reciprocal action; the reflexive forms are used, and when context is not enough, speakers resort to fixed phrases like mutuamente or uno al otro, unos a otros.
As for the passive: we have dealt with the history of the Spanish passive voice before. Latin had a synthetic passive voice, i.e. passive voice was indicated by a form of conjugation, same as mood, tense, person and number are. There were deponent verbs, which conjugated always in the passive voice, morphology-wise, but were actually active in meaning. When this morphological passive was lost, Latin began using a periphrastic passive construction with the verb esse plus the perfect participle instead, but this was ambiguous at first because it had both a present and a past-perfect meaning: *amātus sum = "I have been loved" or "I am loved". It appears that for impersonal passive constructions se was used to avoid this: instead of dicitur "it is said" Late Latin used se dicit (mod. Sp. se dice). So there's another usage of se.
For deponent verbs which carried medioactive or mediopassive meanings, the replacement was also se, extending its meaning from truly reflexive action to a wide range of meanings having to do with specific types of involvement of the agent or the patient. These verbs and many others formed on those models ended up as pronominal verbs in Spanish, many of which still carry shades of reflexive meaning (of action or events focused on the patient). That's another use of se.
I think I have covered all or most of the uses of se as a reflexive pronoun, passive, impersonal and pronominal verb marker. There's also sé from saber and from ser, but those are simply homophones and pose no complications (except from their irregular forms).