It might have been either one of the project owners or one of the centralized exchange staff who was able to get an inside information regarding the token pump and decided to buy the token. Although am not sure but I know that it's not usually possible for investors to know the altcoin that is going to make them millions of profit, if it was that possible and easy, that means everyone would have become millionaires. You can still be lucky in your investment but it depends on luck.
I also do agree that there could be some element of luck as well. Specially if you don't have that insider information. And it just so happen that you are in the right place at the right time and invest early.
And later, the price of that token pump up, and you sell at the right time, so another luck in your side. Of course, you still need to put your money and then continue to monitor the crypto sphere of any new and upcoming token. But still with luck on your side, definitely, in the end you are going to win big.