The Supremacy Clause of the U.S. Constitution states that the Constitution, laws and treaties are the supreme law of the land. Obviously, the Constitution supersedes both laws and treaties, but which is given more importance, laws or treaties? For example, if the Congress passed a law in violation of a treaty, would that law be valid? If the Senate ratified a treaty in violation of federal law, would that treaty be valid?
The U.S. law rule is that treaties and laws are co-equal and that one does not supersede the other. In the U.S., the rule is that the last passed law or treaty prevails, over earlier passed laws or treaties if they conflict. See, e.g., Julian G. Ku, "Treaties as laws: A Defense of the Last-in-Time Rule for Treaties and Federal Statutes" 80 Indiana Law Journal 319 (2005) citing cases including Whitney v. Robertson, 124 U.S. 190 (1888).
But, this is not self-evident, Indeed, it is a minority rule of law to the point of pretty much being an outlier. In the vast majority of countries other than the U.S., domestic laws are subordinate to treaties, and there is some hint in the structure of the U.S. Constitution and the discussions of the Founders regarding the treaty power, that this how the Founders assumed that conflicts between treaties and domestic statutes would be interpreted, even though the U.S. Supreme Court ended up interpreting the constitution differently. Few countries in the world give so little legal effect to international treaties and international law, more generally, as the U.S. does. In contrast, in Europe, many human rights protections arise from international treaty obligations that override domestic laws, rather than from their own domestic constitutional law.
Also, while this rule seems simple and mechanical, it rarely presents in the fashion, because there are a variety of tools, such as interpreting treaties and statutes in a manner that avoids a conflict (particularly with respect to questions such as whether a treaty should be considered "self-executing" or not, and a rule of construction that one enactment that does not expressly overrule another should not be deemed to do so implicitly unless there is no interpretation that can resolve the conflict otherwise), that muddy the waters. As Ku, explains in the law review article linked above:
Although the Constitution declares that treaties are the "supreme Law of the Land,"the status of treaties in the American legal system is plagued by uncertainty. A court considering a private individual's claim under a treaty must first consider a number of complex questions such as whether the treaty is "self-executing," whether the treaty's effect is otherwise nullified by conditions placed on it during ratification, whether the treaty exceeds constitutional limitations on the exercise of the treaty power, and whether the treaty conflicts with inconsistent federal and state law.... For instance, in recent years the International Court of Justice ("ICJ") has twice found that U.S. domestic law limiting habeas corpus appeals violated U.S. treaty obligations to guarantee consular notification rights to foreign nationals charged with capital crimes.' The ICJ found a conflict between the treaty and U.S. law even though the U.S. government offered a plausible alternative interpretation of the treaty that avoided conflict with domestic law.
(Despite these findings, the U.S. did not enforce the alleged treaty obligation.)
A good example of this is the case of Bond v. United States, 572 U.S. ___ (2014) (note that it is important to provide a year when discussing the Bond case, because the U.S. Supreme Court made two successive rulings in this case and also established an important precedent in an unrelated case with the same name). Wikipedia's summary of the case explains how the case avoided having to resolve constitutional issues in the case (references to Holland are to State of Missouri v. Holland, linked and discussed below):
Carol Anne Bond is a microbiologist from Lansdale, Pennsylvania. In 2006, her best friend became pregnant. When Bond discovered that her husband was the child's father, she attempted to poison her former friend by putting organoarsenic and potassium dichromate on the woman's door knob. Bond was caught, and was convicted under the Chemical Weapons Act. In her appeal, she argued that applying the chemical weapons treaty to her had violated the Tenth Amendment. The Court of Appeals ruled that Bond lacked standing to make a Tenth Amendment claim. On appeal, the Supreme Court reversed by stating that individuals can bring Tenth Amendment claims. The Court then remanded the case for the Third Circuit to decide the case on the merits.
On remand, the Third Circuit found that "because the Convention is an international agreement with a subject matter that lies at the core of the Treaty Power and because Holland instructs that 'there can be no dispute about the validity of [a] statute' that implements a valid treaty, we will affirm Bond's conviction." Bond again appealed to the Supreme Court, asking the court to overrule Holland or to find that her actions were not covered by the CWA.
The case attracted a great deal of attention, with US Solicitor General Donald Verrilli arguing for the government and former Solicitor General Paul Clement arguing for Bond. Senator Ted Cruz wrote an essay for the blog of the Harvard Law Review, urging the Court to overturn Bond's conviction.
Chief Justice Roberts opened his opinion by vividly describing John Singer Sargent's life-sized painting of mustard gas victims. Roberts closed by noting, "There are no life-sized paintings of Bond's rival washing her thumb."
In its judgment, the Court unanimously concluded that the convention was not meant to cover local activities such as Bond's poisoning attempt. Writing for the Court, Chief Justice Roberts declined to define the scope of Treaty Clause powers, invoking constitutional avoidance. Because the Chemical Weapons Convention is not self-executing and because it requires implementation by a signatory to be "in accordance with its constitutional processes," Roberts focused his attention on statutory interpretation of the federal criminal code.
According to Roberts, one of the key "background principles of construction" is federalism; there must be a "clear indication" by Congress if it intends to "dramatically intrude upon traditional state criminal jurisdiction." The Court concluded that there was no such clear indication in the text of the criminal statute.
Roberts rejected the Solicitor General's interpretation of the statute, noting that the government's reading would make it a federal offense to poison children's goldfish and that state authorities are fully capable of punishing burrito poisoners.
Finally, Roberts briefly responds to Justice Scalia's interpretation by noting that adopting "the most sweeping reading of the statute would fundamentally upset the Constitution's balance."
A well-known line from his opinion is at the end: "The global need to prevent chemical warfare does not require the Federal Government to reach into the kitchen cupboard, or to treat a local assault with a chemical irritant as the deployment of a chemical weapon."
Thus, rather than ruling that a law implementing a valid treaty was unconstitutional, the U.S. Supreme Court interpreted the law implementing the treaty in a manner that did not mean something that would potentially make the law unconstitutional.
The question states:
Obviously, the Constitution supersedes both laws and treaties
This is mostly correct under U.S. law (although it took many decades before that rule was established in precedent), but it was not obvious under U.S. law, it is not true in every country, and it is not entirely settled law in the U.S. even today.
A plurality of the justices Reid v. Covert, 354 U.S. 1 (1957), which enforced the Fifth and Sixth Amendments against a contradictory treaty, stated:
There is nothing in this language which intimates that treaties and laws enacted pursuant to them do not have to comply with the provisions of the Constitution.
A plurality decision, however, is not controlling authority that must be followed by lower courts.
But, in State of Missouri v. Holland, 252 U.S. 416 (1920) had previously reached an arguably contrary conclusion. The official syllabus to that decision noted that:
Protection of its quasi-sovereign right to regulate the taking of game is a sufficient jurisdictional basis, apart from any pecuniary interest, for a bill by a State to enjoin enforcement of federal regulations over the subject alleged to be unconstitutional.
The Treaty of August 16, 1916, 39 Stat. 1702, with Great Britain, providing for the protection, by close seasons and in other ways, of migratory birds in the United States and Canada, and binding each power to take and propose to their lawmaking bodies the necessary measures for carrying it out, is within the treaty-making power conferred by Art. II, § 2, of the Constitution; the Act of July 3, 1918, c. 128, 40 Stat. 755, which prohibits the killing, capturing or selling any of the migratory birds included in the terms of the treaty, except as permitted by regulations compatible with those terms to be made by the Secretary of Agriculture, is valid under Art. I, § 8, of the Constitution, as a necessary and proper means of effectuating the treaty, and the treaty and statute, by bringing such birds within the paramount protection and regulation of the Government do not infringe property rights or sovereign powers respecting such birds reserved to the States by the Tenth Amendment. With respect to right reserved to the State, the treaty-making power is not limited to what may be done by an unaided act of Congress.
Many legal scholars expected that Bond (2014) would resolve the tension between Reid and Holland, but instead, the U.S. Supreme Court punted, and declined to reach that issue in that case.
Arguably, Reid and Holland are not truly in conflict, because Holland addresses the scope of the treaty power in light of federalism concerns, which isn't necessarily identical to the scope power of Congress to enact domestic laws pursuant to U.S. Constitution, Article I, Section 8 in light of federalism concerns, while Reid concerns constitutional provisions which have been interpreted to flatly prohibit the government from abridging certain individual rights at all. U.S. Constitution Article I, Section 8 limits the authority of Congress to enact domestic laws to certain enumerated subjects (with all other powers reserved to the states), while the treaty power is not limited to any particular subject-matter (in part, because states are not permitted under the constitution to enter into international treaties, so the federal government needs to handle treaties involving both national and state level concerns, while states have plenary power to enact domestic laws in all circumstances where they are not expressly prohibited from doing so).
Treaties are laws
In an ideal world, the legislature would not pass laws that conflict with one another. In this world we have a judiciary to sort this out when it becomes an issue.