Example 1.9 of Seber’s book states the following:

The result stating that if $\rho = 0$ it holds that $Q = \sum _i (X_i - \overline X)^2$ has expected value $\sigma ^2 (n-1)$ follows from $\operatorname{tr}(\textbf{A}\Sigma) + \mu ' \textbf A \mu = E[\textbf{X'AX}]$ and the fact that if $\Sigma = \sigma ^2 \textbf{I}_n$ then it follows that $\operatorname{tr}(\textbf{A}\Sigma) = \sigma ^2 \operatorname{tr}(\textbf A)$, with $\mu$ being the expected value vector.
I managed to understand why the matrix multiplication yields the result $\sigma ^2(1-\rho)\textbf A$. What I struggle to understand is why he can/would write write $\textbf A$ in such a way. Where is this matrix $A = [(\delta _{ij} - n^{-1})]$ coming from? It has been a while since I last looked at any linear algebra but when I tried to derive the matrix inducing $Q$ I must have gotten stuck somewhere along the way - or so I think. Perhaps there is something in the notation I am confusing? I don’t know. I would greatly appreciate any help.
Write $$Q = \sum_{i}X_{i}^{2} - \frac{1}{n}\left(\sum_{i}X_{i}\right)^2.$$ Let $H$ be the matrix with all entries equal to one. The first term is $X^{T}X$ while the second one is $\frac{1}{n} X^{T}HX$. Thus $$Q = X^{T}X - \frac{1}{n}X^{T}HX = X^{T}\left(I-\frac{1}{n}H\right)X = X^{T}AX.$$