tl;dr: None of this is ever really explained in the show.
Alia's powers in Savior and Pandora in the present time, in particular, are a huge plot hole (in particular, in Pandora she seems to keep her red-sun-given powers when she follows Lois back to a yellow-sun environment.)
How the red sun gave them their powers appears to be a side-effect of how Blue Krpytonite works; at least, Zod seems very convinced that it will work, enough to spend tons of time and money on the Solar Tower. Why this is true, again, is never explained.
The explanation for how Zod got his powers was very sketchy, but if I am remembering correctly, it's due to the way blue kryptonite affects Kryptonians. It appears to take away their yellow-sun-given powers by changing their biology to make them appear "native" under yellow radiation, but as a side effect, a red sun is no longer normal for them, and has the same effect.
In the comics, IIRC there have been a few different explanations for why Superman has special powers when exposed to a yellow sun. Smallville never explains how that works for their particular canon, but the basic idea is that yellow sunlight is absorbed by Kryptonians and is somehow converted into energy that gives them extra powers. This is somehow related to their biology, and their evolution on Krypton (which is heavier/denser than Earth and orbits a red star). Therefore, all Kryptonians would automatically have these powers as soon as they came within range of a yellow star.
If we assume that blue krptonite somehow interferes with this process, one possibility is that it changes whatever biochemical process responds to yellow wavelengths to make them do nothing. It's possible, then, that the change causes some other wavelength to replace yellow's function. Given that red is the furthest from blue in the actual spectrum, it makes as much sense as anything else that blue krpytonite would interefere with yellow radiation more than red. Beyond that, though, it's all basically hand-waved away as "how it's supposed to work."
None of that explains Alia, though. That's a pretty clear writing mistake that they were hoping we wouldn't notice.