Variance function vs distribution variance In Categorical Data Analysis by Agresti it is stated on page 150, in relation to quasi-likelihood in GLMs, that "with binomial sampling, $E[Y_i]=\pi_i$ and $var(Y_i)=\frac{\pi_i(1-\pi_i)}{n_i}$." It goes on to say that the alternative variance function for overdispersion multiplies this with a scaling parameter $\phi$.
But since $Y_i$ is (I think) the proportion of successes at covariate level $i$, why is $\frac{\pi_i(1-\pi_i)}{n_i}$ the variance and not $n\pi_i(1-\pi_i)$, the binomial variance, since the response is assumed to be binomially distributed? And why is the expected value $\pi$ and not $n\pi$? To me $\frac{\pi_i(1-\pi_i)}{n_i}$looks like the standard error of the asymptotic distribution of the estimate of $\pi$ in MLE for a binomial distribution. I know it's the variance function, but it feels very far removed from the negative binomial variance, which makes me question why the variance function differs from the distribution variance, in an intuitive sense?
For a binomial response $V(Y_i)=v(\mu_i)/w_i=\frac{\pi_i(1-\pi_i)}{n_i}$ where $n_i$ is used as the weight -- apparently the weight is $1/n_i$ when response variable is the sum of the $n_i$ results, which would give my expected result of $n\pi_i(1-\pi_i)$, but here supposedly when dealing with "grouped" $n_i$ the weight is $n_i$...the difference between the two is not jumping out to me

Presumably here the value $Y_i$ represents a proportion rather than a total.  If we have a total $T_i \sim \text{Bin}(n_i,\pi_i)$ then you are correct that it has mean and variance:
$$\mathbb{E}(T_i) = n_i \pi_i
\quad \quad \quad \quad \quad 
\mathbb{V}(T_i) = n_i \pi_i(1-\pi_i).$$
However, if we scale this to get a proportion $Y_i = T_i/n_i$ then we get the mean and variance:
$$\mathbb{E}(Y_i) = \pi_i
\quad \quad \quad \quad \quad 
\mathbb{V}(Y_i) = \frac{\pi_i(1-\pi_i)}{n_i}.$$
The value $1/n_i$ here is not the weight function; it is just a natural part of the variance of the proportion value that comes from the size parameter in the binomial.  When Agresti refers to the scaling parameter $\phi$ as a means of dealing with overdispersion, he means that the model is altered to use the alternative variance:
$$\mathbb{V}(Y_i) = \phi \cdot \frac{\pi_i(1-\pi_i)}{n_i}.$$
