Why would a law firm bring in appellate counsel before there's even an appeal?

Because an appellate court can generally only review what exists in the trial record and issues that were properly preserved. An appellate lawyer arriving after a loss cannot reconstruct an objection that was never made or an argument that never became part of the record. Embedded appellate counsel joins a case while it's still being litigated, watching preservation of error, key motions, evidentiary issues, and the developing record through an appellate lens, so that if an appeal later becomes necessary, the strongest issues actually exist to appeal.