Courts are the institution that preserve rights and give remedies for them. So access to courts is key: it's the connection between rights and remedies. Again, ironic that the court kicks Marbury out, even though he has rights and wants a remedy. Still, where there are rights and remedies, there should be access to courts.
The other function is the "case-deciding" function. Courts do this too. But they can do this because they're in the position to interpret, articulate, and announce the meaning of the law. This carries over into interpreting jurisdiction-granting statutes and the constitution. If we think it's important that the law be articulated, we want jurisdictional doctrine to accomodate that idea: courts need to shape their doctrines to put themselves in the position to do so. Consider the injury-in-fact test that controls standing. We wouldn't want to have rules of standing doctrine that would keep the court from telling us the meaning of the establishment clause.
Note that this isn't a need of the claimants-- this is more of a general need that we have from courts. Getting the meaning of the rules of law articulated accurately and with precedential power so that it answers our other questions going forward.
OK, let's move on to the case itself. To do that, we need Art III. That's familiar stuff. There were some who thought that the three branches should be coequal. Others thought federal courts might not even be needed, as long as there were state courts. This conflict was resolved by giving Congress the power to control the creation and the jurisdiction of the lower courts. Everyone agreed it was a good idea to have a Supreme Court.
So SCOTUS jurisdiction is divided into original and appellate jurisdiction. Congress also has some power over SCOTUS jurisdiction. See Art III § 2, ¶ 2.
The problem with Marbury is that the case begins in SCOTUS. Why did Marbury think he could to this? There was a statute giving SCOTUS jurisdiction in matters requesting writs of mandamus (the Judiciary Act of 1789). But SCOTUS says that Congress can't ENLARGE the set of things put in original jurisdiction-- the constitution gives them some control over appellate jurisdiction, not original. So the Judiciary Act, though it would have upheld Marbury's ability to use the courts in this way, was in conflict with Art 2 § 2 ¶ 2. So that gives us an occaision for announcing that there is such a thing as judicial review.
Most people seem to have agreed that this power existed, by the way, but Marshall was looking for a chance to say it formally.
If the court had given Marbury his remedy, the executive might well not have handed over the commission, and that would have weakened the court at a time when it was just getting started. So this also gave SCOTUS a chance to wiggle out of a pesky trouble.
So all that the court needed to do was nothing: the court simply found that it did not have jurisdiction. Not much consolation to Marbury, of course, who gets told he has a right (and therefore a remedy, and in fact the very one he wanted), but then gets sent home because the court conveniently finds that it did not have jurisdiction, regardless of all its pro-rights rhetiroc.
Another key concept: the courts have political capital and need to be concerned about their own prestige. This is pretty much the main force behind prudential reasoning and judicial restraints: courts are aware of their own vulnerability in the political system. This is a rival idea to the theme of courts being independent and standing up for the downtrodden and giving remedies. Often they'll defer to the political branches out of awareness of their own position. Judges don't have the power of the sword or the purse. They can only order-- what if nothing happens? Judges need people to buy into their power, or it collapses.
Where there is law, everyone-- including the President-- needs to obey. That's a loud-and-clear message in Marbury, but yet in the end, we get restraint: the court wriggles out of the embarrassment of seeing their order not followed. Of course, that motive is wholly unspoken-- Marshall says quite the opposite-- but the effect is that the court leaves the executive alone, and President Jefferson gets his way.
Some people might say that judicial restraint is itself unconstitutional: it represents an exercise of political power. They're supposed to be independent-- that's what the lifetime appointments are about: they should have blinders on about politics. How does judicial restraint make sense in a government of laws? The courts only have power because the don't make policy decisions, right? Well, that's one reason why Marshall claims all he's doing is articulating what the law means.
Note that he really shouldn't have bothered with the first 50% of the opinion, the discussion of the merits. Nowadays, if there's a jurisdiction issue, you analyze that first, and don't even reach the merits unless it's in your power to do so. Nevertheless, when he's talking about Marbury's rights, he's talking pretty much solidly about the law, and saying that where there's a legal right, it can be asserted even against the President.
Pretty deft: he gets out of the case, but still gets to lecture the President about the law. But if he's making such a deft political move, he doesn't have his political blinders on: he's exercising judicial restraint. At the same time, if he were timid, he wouldn't have said all that stuff. Maybe it's a cowardly attack, though: he attacks, but in an almost risk-free way (he could have been impeached, perhaps), by giving a decision that doesn't depend on anyone outside the court to do anything.
Good question to ask: is there judicial restraint involved in a jurisdiction question (even if it's hidden)? Sometimes yes, sometimes no.