Why is this equation for TAS only valid for subsonic flow? I came across the equation for calculating True airspeed (TAS) on Wikipedia:
$$ \text{TAS} = a_0 \sqrt{\frac{5 T}{T_0} \left[ \left( \frac{q_c}{P} + 1 \right)^{2 / 7} - 1 \right]} $$
But this equation is apparently valid for only subsonic flows.
Why is that? Does this have something to do with pressure?
Because you didn't read the text in the Wikipedia page above that equation ;-)
That equation works for subsonic flow only because you have replaced the Mach number of the original TAS formula:
$$ \text{TAS} = a_0 M \sqrt{\frac{T}{T_0}} $$
with the formula of Mach number for subsonic flow:
$$ M = \sqrt{\frac{2}{\gamma - 1} \left[ \left( \frac{q_c}{p} + 1 \right)^\frac{\gamma - 1}{\gamma} - 1 \right]} $$
which exploit the simple form of Bernoulli's formula, working only for incompressible flows, i.e., subsonic flows. Check the Mach number and the Bernoulli formula pages for further details.