Here is my theory, which has absolutely no official confirmation.
REQUISITION PHASE: Piles are refilled as soon as they are empty. REASON: I don't remember seeing anywhere, throughout the entire playtesting, that you are someway limited in buying cards.
AFTERMATH PAHSE: Piles are refilled as soon as they are empty. REASON: I don't remember seeing anywhere that cards wouldn;t flip for unenegaged ships because the piles were empty.
There are two significant problems with this theory: 1) It specifically says in the Wrap Up Event to refill cards. 2) We have a rule for how to refill piles if more than one pile is empty at once. Neither of these rules will apply if the theory is only the first two.
Therefore, while cards will always refill immediately, they won't during the Opposition Flips Cards Events. REASON: This is the most likely time that a bunch of cards from each pile will leave (and as mentioned before, it doesn't make sense to have this restriction on the Requisition Phase). However, if you refill the cards immediately, you can be left with a very strange situation. Once the first card is flipped and the pile empty, it will immediately get its five cards. however, if there are only five cards left, then the other piles won;t get any. Therefore, there should be an even distribution then
This actually comes up a lot. If you abandon a Sector early, it is not uncommon for all the cards to flip, and empty at the same time. If it did so, and you refilled the cards immediately, only one card would flip from then on.
There are still two issues to be resolved: First, do Station Piles only refill during the Requisition and Aftermath phase? It could be, but it might not. The rulebook only puts rules by the phase most likely to have that rule occur (removing Energy is mentioned during the Damage Event, even though it can happen anywhere). regarding cards, the only phases that cards get moved a lot are during the Requisition and Aftermath phase. However, through Boosts and Techs, not to mention Opp Icons, cards can be removed from the piles. Once again, I don't recall anywhere that there should be some restriction on using those abilties.
The second question is whether or not a pile is refilled immediatetly, or only after an action is resolved. The best example is using Black Market Contact with only one card in the Station. Would the pile get refilled immediately, and Tharendim gets two cards, or only one. Once again, I don't remember seeing any restrictions like this with buying cards.
Of course, this is only speculation, and we will wait and see what the official answer is.
EDIT: Yes, I do realize that players can buy cards so that one pile empties first and, possibly, putting all of the remaining cards in that pile. However, if it tried to have the same rules as the Aftermath, it would limit what cards you can buy.