Well, I don't think we get a clear explanation. Just that he had follows, he existed before Alphys, and there's a Monster Kid who's in the same boat but we don't know what happened. Actually, do we know what Gaster did as a scientist?
Oh uh, we practically know nothing about Gaster, not even his real appearance. We just assume this random Mystery Man is him, and that he's the father of the skeleton brothers or something.