The underlying idea has been implicit in law for over a millenium in England. The term dates back at least to Sir Matthew Hale who cites his doctrine of stare decisis in Hanslap v. Cater (1673). Blackstone in Commentaries of the laws of England Book 1 section 3 explains that the laws "receive their binding power, and the force of laws, by long and immemorial usage, and by their universal reception throughout the kingdom" – this is what stare decisis is "about". In the same era as Hale, Coke in Institutes of the Lawes of England explains that
"our book cases are the best proofs what the Law is"
and are cited as authority for what the law is.
This may seem a bit strange in an era where "the law" is meticulously documented and instantly available on your phone, but the whole point of developing "the common law" since Henry II was to create a single legal system supplanting myriad local systems (Mercian, West Saxon and Danish Law), the content of which were not clearly established. As Blackstone explains,
But here a very natural, and very material, question arises: how are
these customs or maxims to be known, and by whom is their validity to
be determined? The answer is, by the judges in the several courts of
justice. They are the depositary of the laws; the living oracles, who
must decide in all cases of doubt, and who are bound by an oath to
decide according to the law of the land. Their knowlege of that law is
derived from experience and study
...
these judicial decisions are the principal and most authoritative
evidence, that can be given, of the existence of such a custom as
shall form a part of the common law.
Blackstone states that
it is an established rule to abide by former precedents, where the
same points come again in litigation; as well to keep the scale of
justice even and steady, and not liable to waver with every new
judge's opinion; as also because the law in that case being solemnly
declared and determined, what before was uncertain, and perhaps
indifferent, is now become a permanent rule, which it is not in the
breast of any subsequent judge to alter or vary from, according to his
private sentiments: he being sworn to determine, not according to his
own private judgment, but according to the known laws and customs of
the land; not delegated to pronounce a new law, but to maintain and
expound the old one.
It is assumed that judges competently perceive what the law is, and that the law is a non-contradictory whole. It would therefore be a contradiction to flout a prior decision, unless of course the earlier decision was clearly in error. Yet, Blackstone notes that
this rule admits of exception, where the former determination is most
evidently contrary to reason; much more if it be contrary to the
divine law. But even in such cases the subsequent judges do not
pretend to make a new law, but to vindicate the old one from
misrepresentation. For if it be found that the former decision is
manifestly absurd or unjust, it is declared, not that such a sentence
was bad law, but that it was not law; that is, that it is not the
established custom of the realm, as has been erroneously determined.
For an extended treatment of precedent and stare decisis, see Duxbury (2008) The nature and authority of precedent.