Pile shuffling does not randomize the cards. It introduces exactly zero randomness, and maintains a significant amount of information even from round to round. I may be wrong, but I seem to recall that for N cards piled into M piles, as long as N mod M = 0, there is some number X of pile shuffles for which the original arrangement of cards will be reproduced, with that X related somehow to N/M.
That there is a X is quite clear, you even don't need N mod M = 0.
There are only finite many permutations, so there must be a cycle. As pile shuffling is invertible (even if N mod M != 0), the cycle must return to the starting point, otherwise you would have one permutations which is the image of at least two pile shufflings, which contradicts the invertablilty.
That something like N/M plays a role I can believe, but I don't know how to show it atm...