In this answer DVK says, that "Lily's protection magic was triggered by her choosing to die to protect Harry". Has she got or knew anything, that would let her believe, that her sacrifice will save Harry? Or was it -- like JKR says in an interview mentioned by Slytherincess -- something, that any normal mother would have done for her child (no magic or mystery involved)?
Zero canon evidence that Lily had any idea her sacrifice would protect Harry. Lot's of circumstantial evidence to say she didn't.
No one knew
No-one in the world, save Dumbledore, understood how Harry survived. This suggests that there is little or no research or documentation on this effect, since surely someone else would have looked into it and discovered the truth?
Voldemort himself describes it as "old magic", the implication being that it is far beyond the realms of what we could call "ordinary" wizards. He was the second most powerful wizard of the age, and he had to have it explained to him (though to be fair, he obviously understood the magical principles behind it) by Harry. Lily was clever, but she wasn't anywhere near Riddle's league.
Other answers have pointed out that JK has stated that this isn't a formula that you can repeat - the old magical rules are far more vague and elemental than what's portrayed in the series proper. Even knowing that the effect COULD happen might stop it from doing so.
She did not know, which is exactly why the magic worked, and why it is so rare.
Even though it is possible Voldemort would have spared her after he had killed Harry, she still gave her own life trying to protect him.
Her sacrifice was so selfless because she gave her life trying to protect Harry despite knowing in the end it would be futile. Once she was dead there would be nothing standing in the way of Voldemort.
If she had even the slightest knowledge that her death would mean Harry was spared, then the act would have been inherently self-serving, as she would essentially be trading her life for Harry's, meaning that the act would not have been selfless and would not have worked.