Zevachim 5 - Why is an Erroneous Sacrifice Valid?

Said Resh Lakish, "We know that if one brings a sacrifice for the sake of a different one, it is valid, but is not counted toward the owner's obligation. But that is not logical! If the 'for the sake of' requirement is important, the sacrifice should be altogether invalid. And if it is not that important, it should count toward the owner's obligation!"

He found the answer in the Torah phrase, " What emerges from your lips you shall observe and carry out, just as you vowed... a freewill offering ." A freewill offering (nedavah) means that one promises to bring a sacrifice, but not a specific animal. On the other hand, a vow ("neder") occurs when one points to an animal and promises to bring that specific animal.

Why does the Torah call it both a vow and a freewill offering? - To tell you that if you did as you vowed, and brought the offering for its sake, you have fulfilled your vow. But if you brought it not for its sake, then it becomes a freewill offering, additional to your vow; it is brought and is valid, but it does not fulfill your vow obligation.

Art: Benjamin Eugene Fichel - A Gentlemans Debate