From the appellate
court's view, what matters is whether any of the complaints stated facts sufficient to prove any legally cognizable cause of action. Example: Suppose you claim breach of contract
as a count/cause of action. A breach occurs where the parties agree to some sort of performance and a party fails to perform. So, if you state in your facts that a vendor agreed to sell you a hot dog in exchange for $1.00, you further state that you paid your dollar, but that the defendant handed you a polish sausage, then those facts demonstrate that a contract
existed, and that the defendant failed to perform, which satisfies the elements.
Now, let's say that claim to have walked up to the vendor and handed him $1.00, and the vendor hands you a polish sausage. And, let's further say that nowhere on the vendor's stand does it say "Hot Dogs $1.00." You don't have a claim for breach of contract here, because you haven't proved that there was any contract to begin with.
But, from the appellate court's position, there is
a cognizable claim: the vendor kept your $1.00 and ignored you, and that raises a claim for quasi-contractual unjust enrichment. The vendor received benefit of $1.00 from you in expectation of the return benefit of a hot dog, and you received nothing at all. Thus, the vendor was unjustly enriched, and you have an equitable claim for reimbursement of your $1.00.
If the trial court failed to recognize the cognizable quasi-contract claim, then the dismissal was incorrect, and the appellate court must reverse (assuming that the appellate court judge has the other half of the brain which may have been missing from the trial court judge -- and we certainly hope so).
That's how the appellate court reviews a motion to dismiss for failure to state a claim.
Hope this helps.