The basic question is this. You're given a proposition S with n variables. Any proposition can be rewritten in either conjunctive normal form or disjunctive normal form. That is, n is a function of m, and that function is a polynomial. The Nondeterministic part comes from making the guesses.
Many important problems fall into each category.
We can write this as a decision problem, but I'll make the informal jump to more general problems. Now consider the opposite problem of factoring a number. This is much more difficult. No one knows for sure. That is, if a problem is in P, then we can solve it from scratch in polynomial time.