Note that the piles needn't be the same size! Choose any 10 coins to make one pile, then turn over all 10 coins in that pile. The number of tails in this pile is now equal to the number of tails in the other pile of 90 coins. To see this, suppose there were x tails in the 10-coin pile. Since there were initially a total of 10 tails, there must be 10-x tails in the pile of 90 coins. When you flip over all 10 coins in the smaller pile, the x tails in that pile become heads and the remaining coins, which must be 10-x heads, become tails. That matches the larger pile.