There are the basic rules in the Quran and the prophet’s sayings. But a lot of cases turn up that need new rules or decisions. What should happen, and that’s what really happened in the time of khilafa (unified rule), is going back to the general rules and coming to a new decision. If the ruler comes to one, and ANYONE sees it’s wrong, he has every right to object.
Here’s an example:
Khaleefa Omar bin Khatab was telling people about a new law for women. A woman stood up and told him about a verse that didn’t go with his law. He at once complied and said his famous saying, “A women was right, and Omar was wrong”.

So the Quran and the prophet’s sayings have all we need. You won’t know that unless you read them.