I'm trying to find out information about the Spanish pronoun
"se" when used as an indirect pronoun. For example:

  Yo se lo mandé  "I sent it to him"

All Spanish learners have heard their teachers say
that the pronoun "le" magically turns into "se" when
followed by  lo/la/los/las. Couldn't there be something
more to it. I was thinking that perhaps "se" is a descendant
of "ipsi" the dative of "ipse".

Any help would be greatly appreciated. Thanks!