Where do they get that right? By treaty?
Or perhaps the European Court of Justice simply 'ruled' that it's laws were 'supreme' in a bizarre act of defining it's own jurisdiction outside of treaty agreements?
Europeans never agreed to give the ECJ supremacy. The ECJ just 'took' that power.
It's a baffling bit of legal history [1][2] and it demonstrates just how powerful these institutions can become outside of democratic norms.
A quote: "The principle was derived from an interpretation of the European Court of Justice, which ruled that European law has priority over any contravening national law, including the constitution of a member state itself. The majority of national courts have generally recognized and accepted this principle, except for the part where European law outranks a member state's constitution. As a result, national courts have also reversed the right to review the conformity of EU law with national constitutional law."
Because of this and the resulting vaguery, it's still not always perfectly clear which 'court' is supreme in exactly what ways.
The Germans resolve that EU laws cannot contradict their Basic Law - to be determined by their own Supreme Court, which is kind of a backwards way of saying 'our national courts still have supremacy'.
It would be pretty interesting to see Poland take on the ECJ in this case, because it might cause an EU level constitutional crisis as they'd probably challenge the legitimacy of the 'Supremacy' ruling from 1964 that set the precedent.
It's not as clear cut as the headlines would have us believe, like for example a US State taking on the Supreme Court.
Even in Canada, the provincial leaders invoke Constitutional shenanigans to make up their own laws that can't be rescinded by the constitution.
We'll have to see what happens.
[1] https://eur-lex.europa.eu/summary/glossary/primacy_of_eu_law...
[2] https://en.wikipedia.org/wiki/Primacy_of_European_Union_law