When finding the prime factors of a given number, it is enough to divide n by x where x is the smallest number which n can be divided evenly by, this process is then repeated until n can no longer be divided, at this point we have found all prime factors of n.
Why does this work? Taking the example of the number 30, the smallest divisor is 2, 30 / 2 = 15, we take 15 / 3 = 5 and then we can't divide further. So 2, 3 and 5 are the prime factors of 30.. Right I understand that but those aren't the only divisors of 30, how can it be "enough" to simply start from the lowest number and work our way down from there?
Every integer has a prime factorization (and that factorization is unique). Now let $x$ be the smallest number (greater than $1$) which divides $n$. It must be prime, for if it weren't, then some prime $p$ would divide it, so that $p$ would also divide $n$. So at the first step, you are actually dividing by powers of the smallest prime that divides $n$.
Now if I understand your question, you are doing this again with the smaller number $n/\text{some power of $p$}$. The same argument as above applies.
So at each step, the smallest positive divisor of what's left is in fact the smallest prime dividing that number.
Edit for OP's comment below: In your example, as you point out, you start with $2$, not $10$, since $2$ is the smallest number dividing $30$. The smallest number dividing $30$ couldn't be $10$, since $10$ is not prime, so it has a smaller number dividing it (namely either $2$ or $5$), and since $2$ divides $10$ and $10$ divides $30$, it follows that $2$ divides $30$. So you wouldn't have started with $10$. This argument applies to any divisor of $30$ that is not a prime.