I come from a country with a civil law system, so please excuse me if I'm misunderstanding things here, but isn't the legal precedent already established? How would something like this come to court again? Same with Roe v. Wade. There's already been a ruling by the Supreme Court, how can there be another one?
The Supreme Court can overturn precedent. For example, Plessy v Ferguson (which held that segregation was legal) was overturned by Brown v Board of Education (which held that it was not). More recently, South Dakota v Wayfair directly overturned Quill v North Dakota in holding that states can directly charge sales taxes on internet purchases from out-of-state businesses.
The Supreme Court is a political institution, none of the members have any obligation to precedent, and they aren't required to be lawyers. There's a lot of pomp and rhetoric around it that implies otherwise, but that's required in order for it to maintain the respect it needs to function.
The Supreme Court is not prohibited from overturning existing precedent. They just generally choose to operate under a doctrine that says they should try to avoid overturning precedent. Lower courts are more formally bound by precedent from higher courts, but their rulings as constrained by precedent can be appealed up to the level(s) that are empowered to overturn the relevant precedent.
(IANAL. As I understand it,) Precedent is generally followed unless there is a difference of circumstance, which could include changing cultural mores.
The (old) British legal scholar William Blackstone dives into it in his work "Commentaries of the Laws of England" (Introduction - Section 3) if you want a more thorough understanding of the foundation of precedent in common law.
Legal precedent is established until the laws change. The various legislatures/governing-bodies of the US can change the law whenever they please. When those laws then come into conflict with other laws out there, you have to have a ruling by a court. Sometimes this is intentional.
Which court does the ruling is super complex and sometimes they are not called courts, FYI. Judicial bodies, sometimes called courts, are also super complex. In general, the US legal system is more like the Ancien Régime than anything else, in that we strive to make sure no two people are governed under the same law. Just kidding, sorta. ;)
In the case of SCOTUS, they mostly rule on matters that affect the US constitution, and only if they feel doing so. They then make a ruling, and that becomes the new way the laws work. Sometimes this makes a law null-and-void, sometimes it just sets guidelines on how to make a law function. Again, super complex. There are many other courts in the US that can similarly do things at laws, but SCOTUS gets the most news.