First off, a bit of technical pedantry: the expression
$$ \frac{8x+4}{x^2-4} $$
is not a partial fraction. This expression is a rational expression, which we would like to decompose into partial fractions. In this problem, the partial fractions will be the rational expressions which compose the decomposition.
Getting to the problem itself, I think that you might be thinking about it backwards. Here is how I like to think about partial fraction decomposition: we have this nasty rational expression, i.e.
$$ \frac{8x+4}{x^2-4}, $$
and we ask
Is it possible that this rational expression can be decomposed into simpler rational expressions with more tractable denominators?
In the case of the problem given, we note that
$$ \frac{8x+4}{x^2-4} = \frac{8x+4}{(x-2)(x+2)}. $$
The denominator on the right "looks like" the common denominator of two fractions, one of which has denominator $x-2$, and the other of which has denominator $x+2$. Because it looks like this fraction might be the result of adding two fractions together, we make a leap of faith and assume that there are two fractions $\frac{a(x)}{x-2}$ and $\frac{b(x)}{x+2}$ such that
$$ \frac{8x+4}{x^2-4} = \frac{a(x)}{x-2} + \frac{b(x)}{x+2}, \tag{1}$$
where $a(x)$ and $b(x)$ are functions which depend on $x$. A priori, this assumption is not entirely justified (nevermind that it could be justified with some more theory; we don't need to justify it right now). However, if we really can do this, then we should be able to work out what $a$ and $b$ have to be.
If we assume that (1) holds, then the next step might be to clear the denominators (i.e. multiply both sides of the equation by $x^2-4$ in order to simplify things a bit). If we do this, we obtain
$$ (1) \implies
8x + 4 = a(x)(x+2) + b(x)(x-2)
= (a(x)+b(x))x + 2(a(x)-b(x)).$$
It could be that $a$ and $b$ are very complicated functions of $x$, but let's make another assumption: let's assume that $a$ and $b$ are fairly simple functions. In some sense, the simplest assumption that we can make is that both $a$ and $b$ are polynomials. Then, since the left-hand side is a polynomial of degree 1, it follows that $a(x) + b(x)$ can be at most degree 0 (because, if not, the first term on the right would have degree greater than 1, which is problematic). This further implies that both $a$ and $b$ are constant functions which do not depend on $x$. Simplifying things a bit, we can write
$$ 8x+4 = (a+b)x + 2(a-b), \tag{2}$$
where both $a$ and $b$ are constants (pardon the abuse of notation—they were functions earlier).
The question now becomes
What are the possible values of $a$ and $b$ that will satisfy this equation?
One possible approach is to notice that two polynomials are equal to each other if and only if their coefficients are equal. In other words, we need
$$ 8 = a+b \qquad\text{and}\qquad 4 = 2(a-b). $$
This is a system that we can solve in a reasonably simple manner:
\begin{align*} 8 = a+b &\implies a = 8-b \\
&\implies 4 = 2(a-b) = 2(8-b-b) = 16 - 4b \\
&\implies 4b = 12 \\
&\implies b = 3 \\
&\implies a = 8-b = 8-3 = 5.
\end{align*}
Alternatively, if we go back to (1) and leave it in the form
$$ \underbrace{8x + 4}_{=f(x)} = \underbrace{a(x+2) + b(x-2)}_{=g(x)}, $$
we can think of the left- and right-hand sides as functions which must be equal for all values of $x$. But when $x=2$, the term involving $b$ dies, and when $x=-2$, the term involving $a$ dies. That is
$$ g(2) = a(2+2) + b(2-2) = 4a, $$
which must be equal to $f(2) = 20$. Since
$$ 4a = g(2) = f(2) = 20, $$
we have $a = 5$. Similarly,
$$ -4b = g(-2) = f(-2) = -12
\implies b = 3. $$
Note that we didn't have to evaluate these two functions at $x=\pm 2$, it just turns out that this choice makes life easier. We could have evaluated at any two values of $x$ and obtained a system of equations which we could have worked with.
In either case we conclude that $a=5$ and $b=3$. Then, carefully examining the chain of implications, we can conclude that if the original expression allows a decomposition of the form given in (1), then we must have $a(x) = 5$ and $b(x) = 3$, i.e. it must be the case that
$$ \frac{8x+4}{x^2-4} = \frac{5}{x-2} + \frac{3}{x+2}. $$
We can confirm that this works by multiplying out the right-hand side.
Notice that I have told a story here about first making an assumption, following that assumption to its logical conclusion, then checking that the logical conclusion actually works. This is the way to develop the mathematical idea. In practice, it is possible to prove that these kind of decompositions always work out (with appropriate assumptions imposed on the numerators). So, while I made a big deal out of not having a justification for the first assumption we made, it turns out that things will always work out nicely for us in this setting.