That’s a tough question. I think legally the SSA would have to pay the rightful owner of the number any monies reported. Given that the illegal alien broke the law by using said number they get nothing. JMHO (I know it won’t be that simple)
Assuming he/she claimed it or could be found and was legally entitled..
I thought SS was just a big ponzi scheme where all the revenue is put into one pot and the 1st to eligibly retire get the first $. As the population of younger folks (payers)winnows, the ponzi pot empties leaving the last eligibles to have a place at the hind “boob”. (hind boobs are notorious for little milk production leaving the suckler, well...eh....sucking.)
Since we are talking about the Federal government, I am rather surprised they don't confiscate all the earnings of the rightful owner and give them to the illegal alien who stole the Social Security number. That is more in keeping with their mentality and what they think of mere citizens and taxpayers.