In these cases, the Supreme Court was ruling on the Commerce Clause and its meaning. It was ruling on the degree to which the states could make regulations that would have an impact on interstate commerce, which is the federal government’s to regulate under the Commerce Clause.
In Gibbons, the Court ruled that the state of New York’s grant of monopoly steamboat privileges on their waters went directly against the commerce clause. It prevented other steamship companies from carrying between New York and other states. What the Court did not decide was how much regulation the states could impose before running afoul of the Commerce Clause. To put it in modern terms, we can imagine that speed limits in different states affect interstate commerce. When driving from one state to another on the freeway, you may have to slow down. Is that a violation of the Commerce Clause?
The Court needed to address this. It did so in part in Cooley. In that case, it ruled that a requirement that ships hire local pilots to guide them into Philadelphia harbor did not violate the Commerce Clause. It ruled that some aspects of commerce fundamentally had to be uniform across the country while some aspects (such as piloting or speed limits) could easily be left to the states without harming commerce.