The $2^5$ comes from choosing the colors of the balls. The factor ${10 \choose 5}$ is the number of ways to choose which numbers will be represented, but you still haven't specified which ball of each number.
The $2^5$ comes from choosing the colors of the balls. The factor ${10 \choose 5}$ is the number of ways to choose which numbers will be represented, but you still haven't specified which ball of each number.