The Supreme Court is infallible only in that their rulings are unchallengable, at least through any judicial process. Dissents often explain how the dissenter thinks a decision is not only wrong, but horribly misguided. Law review articles and other publications often criticize Court decisions, and sometimes influence later results.
It is far from unheard of for a dissent to later be followed in an opinion overruling the previous decision. John Marshal Harlan I was known as the "Great Dissenter", but many of his dissents were later adopted as governing law, including his famous dissent in Plessy v. Ferguson, 163 U.S. 537 (1896), the case that created the "separate but equal" doctrine overturned more than 50 years later in Brown v. Board of Education of Topeka, 347 U.S. 483 (1954).
(The Justice is known as "John Marshal Harlan I" because his grandson, also named "John Marshal Harlan", was a Justice during the mid 20th century. The grandson is known as "John Marshal Harlan II' or just as "Harlan II". Harlan II was significantly more conservative than his grandfather.)
Supreme court decisions may be overruled because there has been a change in the constitution. An example is Barron v. Baltimore, 32 U.S. (7 Pet.) 243 (1833) which was undone by the ratification of the 14th amendment. This reason is rare, but particularly important.
Decisions interpreting statutes can be altered or reversed if Congress or a state legislature changes the statute. Indeed sometimes a Court decision explicitly invites a legislative change. Not infrequently, however, such invitations are ignored by Congress.
Supreme court decisions may be overturned when a later majority decides that the previous decision was simply wrong. A special case was Dred Scott v. Sandford, 60 U.S. (19 How.) 393 (1857). That decision held that blacks could never be citizens of the US, and was effectively overruled by the outcome of the US Civil War, and formally by the 13th and 14th amendments to the Constitution.
A more usual example is the case of West Virginia State Board of Education v. Barnette, 319 U.S. 624 (1943) the case that held that a state could not make the flag salute and Pledge of Allegiance mandatory for school children. This overruled Minersville School District v. Gobitis, 310 U.S. 586 (1940), decided only three years before. In this case the opinion included what was in effect a point-by-point refutation of the Gobitis opinion, although it was not described as such. This angered Justice Frankfurter (author of the Gobitis opinion), who issued a dissenting opinion from the Barnette decision. Many prominent lawyers and legal scholars had challenged the Gobitis decision, and Gobitis had led to increased persecution of members of the Jehovah's Witnesses, the group whose members refused to say the pledge, considering that it was a form of idolatry. These facts influenced the rapid reversal of the Gobitis decision.
Often an earlier decision is not directly overruled, but is distinguished. That is, the earlier opinion is said to still hold for its particular facts, but a new and different ruling applies to the different circumstances of a later case. When a number of yet later decisions follow the later case, the original can become effectively overruled, as there are no longer any circumstances in which it will be applied.
Court opinions will often go into considerable detail on the legal reasoning which supports a decision that overrules a previous case. They do not commonly discuss the philosophy of the reasons for change.
Some legal scholars and some Justices have used the Living Constitution theory to support change on the ground that what was constitutional many years or decades ago is no longer permissible as the constitution "evolves and adapts to new circumstances even if the document is not formally amended". Others, particularly "textualists" and "originalists" strongly disapprove of this theory.
This theory was expressed by Justice Holmes in the case of Missouri v. Holland 252 U.S. 416 (1920) with the words:
With regard to that we may add that when we are dealing with words that also are a constituent act, like the Constitution of the United States, we must realize that they have called into life a being the development of which could not have been foreseen completely by the most gifted of its begetters. It was enough for them to realize or to hope that they had created an organism; it has taken a century and has cost their successors much sweat and blood to prove that they created a nation. The case before us must be considered in the light of our whole experience and not merely in that of what was said a hundred years ago. The treaty in question does not contravene any prohibitory words to be found in the Constitution. The only question is whether it is forbidden by some invisible radiation from the general terms of the Tenth Amendment. We must consider what this country has become in deciding what that amendment has reserved.
In the Death Penalty cases the citation of "evolving standards of decency" from Trop v. Dulles, 356 U.S. 86 (1958) in Furman v. Georgia, 408 U.S. 238 (1972) was a version of Living Constitution theory. But it was not followed in later cases on he subject.
US Supreme Court rulings are not strictly binding on future Supreme Court majorities if they truly believe the previous decision was wrong for whatever reason. This has happened many times. Some Justices believe fairly strongly in stare decisis, the principle that settled rules of law should not be changed, but even so they will vote to overturn a precedent when it seems clearly and seriously wrong. Prior cases are overturned with significant frequency.
Justices routinely do their own research, and decide cases on grounds not urged by the lawyers who argue the case. Moreover, for significant cases, there are almost always amicus curiae (friend of the court) briefs from major organizations. These are very likely to point out precedents or lines of reasoning that the parties have missed. The chance of a modern SC case being wrongly decided because of poor advocacy (as a comment suggests) seems slight to me. Poor judging, yes, that does happen. The Barnette decision. was an example. There have also been changes of judicial philosophy. The death of "substantive due process" and "freedom of contract" in the 1930s is an example of that.
But when consequences or legal theories are raised that were not previously considered, that can also be a reason to reverse a prior Supreme Court decision.