Counting problems come down to one question: does the order of the selection matter? If it does you want permutations; if it does not you want combinations.
A worked distinction
Choosing three people from ten to be president, secretary and treasurer is a permutation: 10P3 = 720, because swapping two of them produces a different outcome. Choosing three people from ten to form a committee is a combination: 10C3 = 120, because a committee is the same committee however you list its members. The permutation count is always larger by exactly r!, the number of ways to order the chosen group.
Repetition changes everything
If items can be reused — digits in a PIN, for instance — the count becomes n^r. A four-digit PIN has 10⁴ = 10,000 possibilities, but a four-digit code with no repeated digits has only 10P4 = 5,040.
Combinations are binomial coefficients
nCr is the same object as the coefficient of xʳ in the expansion of (1 + x)ⁿ, and the same as the entries in Pascal’s triangle. That connection is why combinations appear throughout probability, from coin-flip distributions to the binomial theorem.