The principle of stare decisis (Latin for "to stand by things decided") leads courts to rule on cases before them according to legal interpretations that have already been laid out in previous cases.
According to the US Supreme Court in Kimble v. Marvel Enterprises, stare decisis "promotes the evenhanded, predictable, and consistent development of legal principles, fosters reliance on judicial decisions, and contributes to the actual and perceived integrity of the judicial process."
For courts, there are actually two forms of stare decisis: horizontal and vertical. "Horizontal" stare decisis involves a court applying its own prior decisions when making new decisions. "Vertical" stare decisis involves a court applying decisions made by higher courts. For instance, if you brought a case in the US District Court for the Eastern District of Michigan, the court might apply one of its own previous decisions to help it decide your case (horizontal stare decisis), or it might apply a decision from the Sixth Circuit Court of Appeals or the US Supreme Court (vertical stare decisis).
Although stare decisis primarily plays a role in how laws are interpreted and applied to court cases, legislatures also consider prior laws and court decisions when drafting new laws. For example, the federal legislature defers to the restrictions placed upon it in the US Constitution when drafting laws. State legislatures similarly defer to their state constitutions. Here, each legislature is accepting what was "already decided" in the constitution as stare decisis, since the legislature has no choice but to abide by the constitution.
In some cases, the legislature has a choice whether or not to keep existing laws, and it chooses to keep them.
For instance, imagine a situation in which one political party has control of both houses of the legislature, but that party loses control to a competing party during an election. The competing party could decide to repeal every law the first party passed and replace them with its own laws—but it usually doesn't. Instead, legislatures tend to lean toward keeping most of the laws that are already on the books, enacting new laws only to update older laws or to address new issues that older laws don't cover.
Finally, legislatures tend to treat "super-statutes" as a form of stare decisis. A "super-statute" is one that attempts to institute a broad set of new norms, in addition to new rules, and/or that has cultural or popular weight. For instance, the US Civil Rights Act of 1967 might be seen as a "super-statute" because it instituted broad reforms, and because today, most Americans can't imagine the US without its Civil Rights Act.
"Super-statute" isn't actually a legal term. The Civil Rights Act doesn't really have any more power or weight than any other law Congress has passed and the President has signed. Rather, "super-statute" describes laws that we give greater cultural significance to.
Because legislators are sensitive to cultural norms, they're more likely to treat super-statutes as stare decisis. Legislators know, for instance, that if they vote to throw out the entire Civil Rights Act, they're likely to face considerable backlash from their constituents—and they might not be reelected. That consideration leads to legislators preferring to treat such laws as if they've already been decided and to create new laws accordingly.