Note that $(1-p_i + p_ix)$ can also be written as $(1-p_i)x^0 + p_ix^1$.
Now imagine multiplying $n$ of those together and looking at the terms with coefficient $x^m=x^{(n-m)\times 0 +m\times 1 }$. So each of the terms in the sum will have $n-m$ multiplicands of the form $(1-p_i)$ and $m$ terms of the form $p_i$ with all the ${n \choose m}$ combinations of possible $0$s and $1$s for the different $i$ appearing such that exactly $m$ of them are $1$.
But this is precisely how you would work out the probability in answer to question 2.
For example, if $n=3$ and the $p_i$ are $0.1,0.2,0.3$, and you wanted the probability of exactly two $1$s then you would calculate $0.9 \times 0.2 \times 0.3 + 0.1 \times 0.8 \times 0.3 + 0.1 \times 0.2 \times 0.7$ but this is the same as the coefficient of $x^2$ in $(0.9+0.1 \times x)(0.8+0.2 \times x)(0.7+0.3 \times x)$