8. Given positive integers $a$ and $b$ satisfying $a < b < 2a$. A rectangle on the coordinate plane with vertices at integer points and sides parallel to the coordinate axes is called a "standard rectangle". A standard rectangle with an area of 1 is called a "square". Some squares on the coordinate plane are colored red. It is known that any $a \times b$ and $b \times a$ standard rectangles contain at least one red square. Find the maximum constant $\alpha$ such that for any positive integer $N$, there exists an $N \times N$ standard rectangle

containing at least $\alpha N^{2}$ red squares.
8. $\alpha_{\max }=\frac{1}{2 a^{2}-2 a b+b^{2}}$.
(1) First, construct an example where $\alpha \leqslant \frac{1}{D}$, where $D=a^{2}+(b-a)^2=2 a^{2}-2 a b+b^{2}$.
Arbitrarily color one grid red, then translate it by $n \boldsymbol{\beta}+m \boldsymbol{\gamma}(m, n \in \mathbf{Z}, \boldsymbol{\beta}=(a, b-a)$, $\gamma=(b-a,-a))$ to get all red grids.

Thus, each $D \times D$ standard rectangle contains exactly D red grids.

Next, prove that each $a \times b$ and $b \times a$ standard rectangle contains at least one red grid.

It suffices to prove that each $a \times b$ standard rectangle contains a red grid. The proof for $b \times a$ standard rectangles is similar.
Let $K$ be any $a \times b$ standard rectangle.
Consider the horizontal strip of width $b$ containing this standard rectangle, which clearly contains a red grid.

Let the center coordinates of this red grid be $(x, y)$. Then $(x+a, y+(b-a))$ and $(x+(b-a), y-a)$ are also centers of red grids, one of which is located within the strip.

Similarly, $(x-a, y-(b-a))$ and $(x-(b-a), y+a)$ are also centers of red grids, one of which is located within the strip.

This indicates that in the horizontal direction, each interval of length $a$ within the strip must contain a point of a red grid. In particular, rectangle $K$ contains a red grid.
From the above discussion, we have $\alpha \leqslant \frac{D}{D^{2}}=\frac{1}{D}$.
(2) For $\alpha=\frac{1}{D}$, the conclusion of the problem holds.
In fact, each $a \times b$ standard rectangle of width $a$ and height $b$ corresponds to the red grid with the highest y-coordinate it contains (if there are multiple such red grids, then it corresponds to the leftmost one among them).
Next, we prove that at most $D$ $a \times b$ standard rectangles correspond to the same red grid.
Assume without loss of generality that the center coordinates of the red grid $A$ are $\left(\frac{1}{2}, \frac{1}{2}\right)$.
Consider the horizontal strip
$\Gamma=\{(x, y) \mid-\infty < x < \infty, \frac{1}{2}-\frac{a+b}{2} \leq y \leq \frac{1}{2}+\frac{a+b}{2}\}$.
Let $T$ be the standard rectangle with vertices at $\left(-\frac{a+b}{2}, \frac{1}{2}-\frac{a+b}{2}\right)$, $\left(\frac{a+b}{2}, \frac{1}{2}-\frac{a+b}{2}\right)$, $\left(\frac{a+b}{2}, \frac{1}{2}+\frac{a+b}{2}\right)$, and $\left(-\frac{a+b}{2}, \frac{1}{2}+\frac{a+b}{2}\right)$.
Let $N$ be a positive integer. Divide the strip $\Gamma$ into $(a+b)N$ segments of length $N$ in the horizontal direction. Each segment contains at least one red grid. Therefore, the number of red grids in $T$ is at least
$$
\frac{(a+b)N}{D}.
$$
Let $m$ be a positive integer. Divide the standard rectangle $T$ into $(a+b)N$ segments of length $N$ in the horizontal direction and $(a+b)N$ segments of length $N$ in the vertical direction. Thus, $T$ is divided into $(a+b)^2 N^2$ standard rectangles of size $N \times N$. The number of red grids in $T$ is at least
$$
\frac{(a+b)^2 N^2}{D}.
$$
The number of red grids in each $N \times N$ standard rectangle is at least
$$
\frac{(a+b)^2 N^2}{D} \cdot \frac{1}{(a+b)^2 N^2} = \frac{1}{D}.
$$
The number of red grids in each $N \times N$ standard rectangle is at least
$$
\frac{(a+b)^2 N^2 \left(N^2 - 1\right)}{D}.
$$
Divide the standard rectangle $T$ into $(a+b)^2 N^2$ standard rectangles of size $N \times N$. Then one of them contains more than $\frac{N^2 - 1}{D}$ red grids. This indicates that the number of red grids in it is at least
$$
\frac{N^2 - 1}{D} + \frac{1}{D} = \frac{N^2}{D}.
$$