We have 10 digits to choose 4 digits.
If repetition is allowed, we'd have 10 digits in the first slot, 10 digits in the second slot, and so on.
Hence, there are 10 000 ways to pick 4 digits.
Now, if repetition is not allowed, then we need to change the restrictions somehow.
If numbers cannot be repeated, then we can have 10 in the first slot, 9 in the second slot, 8 in the third slot, and 7 in the fourth slot, which makes 5040 ways.
If we want to understand this in permutations, then we have 10 objects to pick 4 different numbers, and so we can have 10P4 ways in forming a 4-digit password.