This is quite a complex question. In the USA, the Constitution is not precise about the scope of powers and duties of the different layers and branches of government. It was not until the tenure of John James Marshall, a Federalist judge who served at the SCOTUS between 1801 and 1835, that this complex legal question was clarified during the Marbury v. Madison case.
This case established the principle of Judicial Review, by which the judiciary, one of the three branches of government reviews the actions and/or laws or decrees passed by the other two powers. This means that in terms of Constitutionality, the courts have jurisdiction over the other two branches of government. This is part of the system of Checks and Balances.
the speaker of the house does not have to be an elected member of the house of reresentitives and because the speaker is next to become president it has more power than the president of the senate
It is the "Great Chain of Being"--derived from the thinking of Plato and Aristotle-- that recognizes God as the ultimate authority in government and law, and of course over all humans and animals.