Since you chose Harry Potter specifically: the official Spanish translations were always released several months behind the US. Therefore fan groups gathered to make their own versions by scanning the originals on release night, splitting the chapters among subgroups, translate them in parallel, and then merge them back together. All of this in less than a week.
So while certainly not the case for most books, if you have a pirate Harry Potter then there's a fair chance that an actual human did the translation.
Unrelated, sometimes I'd get a fake unofficial chapter and then I'd have to decide on-the-fly whether Draco undressing Harry felt in line with J.K. Rowling's universe so far.