It’s ‘precedents,’ and it is called ‘stare decisis.’ I heard that stare decisis starting gaining popularity after Darwin’s evolutionary theories gained ground in the late Nineteenth Century....Before that, Cases referred to the Constitution and Blackstone’s Commentaries as a constant reminder of the standard. I don’t know this for certain but it would be interesting to know how much evolutionary thought influenced the law.
It's appropriate to consult precedent in cases where the existing law and statutes would be compatible with mutually-incompatible decisions--i.e. the law and statutes are ambiguous. If the law and statutes are not ambiguous, then precedent is either going to be redundant, irrelevant, or illegitimate.
There are times when it may be appropriate to cite an illegitimate precedent, but only if one is arguing that the illegitimate earlier actions of the government compel a remedy which is not explicitly provided for in the law or statutes. The fact that illegitimate actions may be difficult to unwind does not render them legitimate.