To understand their relation, you should go back to how $\sigma^2$ is defined. Recall that in the discrete case
$$\sigma^2=Var(X)=E[(X-\mu)^2]$$
If you have have all observations in the population, you can calculate this expected value by the formula you first provided
$$\sigma^2=\frac{1}{N}\sum^N_{i=1}(x_i-\mu)^2.$$
When $X$ instead is a random variable, with a probability $p$ of occuring, you have the following formula
$$\sum p_i(x_i-\mu)^2.$$
For the binomial case this is equal to
$$\sum{n\choose{x_i}}p^{x_i}(1-p)^{n-x_i}(x_i-\mu)^2.$$
Rewriting this term, will in fact give us the resulting
$$np(1-p).$$
For a proof of this, just google binomial variance proof. In summary, the formula you first provided is the formula for calculating the population variance. The second formula is how you calculate the variance of a random variable that has a binomial distribution.