Decisions that break with precedent do happen with some regularity, but far "from all the time" in the US. When they do happen, they are generally only at the top level of a state or federal court system, that is a State supreme Court (or equivalent, some states use a different term) or the US Supreme Court.
There are several factors which discourage judges from simply ignoring precedent.
First of all, all the training a lawyer receives teaches him or her to respect precedent, and to find rules by examining past cases. precedent is literally the stuff with which a lawyer works, rather more than the wording of statutes (although those are also important).
Secondly, as a lawyer works as a litigator, judges will usually ground their decisions on precedents, particularly in appellate cases, explaining their decisions largely in terms of how they conform to or extend precedents.
Thirdly, if a lower court judge fails to follow precedent, that judge will often be criticized by an appellate judge or justice, often in the course of an opinion overturning the lower-court judge's ruling. This does not feel pleasant to such a judge.
Fourthly, decision that fail to follow precedent are often (although not always) criticized by legal scholars, particularly in law review articles and treatises.
Fifthly, lower-court judges who often fail to follow precedents, are less likely to be recommended by senior judges for promotion to appellate positions. However, the actual appointments are controlled by politicians (in most cases) not other judges, so this factor may not be as strong it it would first seem.
Only once a judge gets to the level of the Supreme Court of a state, or the Federal Supreme Court, is that judge (now a Justice) expected to alter precedents as needed, and most justices have said that they make such changes only reluctantly.
I am not aware of any US state or federal statute or regulation that specifically;y requires judges to follow precedent.
The most common way to alter precedent is not to overrule or ignore it, but to distinguish a prior case. This happens when a judge says something like:
In the previous case of A v B when had situation X which lead to outcome Q. But in this current case we have the very different situation X1. In the case of X1, the outcome should be S instead of Q.
If the new case becomes persuasive the old case A v B may apply to only one specific set of facts that almost never comes up, and the new rule apply to almost all other possible situations. The old case may cease to be cited or applied without ever being formally overruled.
And, of course, where the rule is statutory, it may be changed if the legislature alters the law. If the rule is constitutional, it may be changed by a constitutional amendment. For example the 1830s case Barron v Baltimore held that the US bill of rights did not apply to the states, only to the Federal Government. But after the 1868 14th amendment, courts started to incorporate much of the bill of rights into the Due process clause of the 14th, and apply it against the states. This took place gradually, mostly during the period starting with 1898, up until about 1970, but with some incorporation coming as late as 2010 (Heller)