Se habían terminado la tarta antes de que yo llegara a casa.

Is this subjunctive? If so, could someone explain why? I get more and more confused the more I look at that verb.

There are some Spanish phrases that trigger the subjunctive automatically, “antes de que” is one of them. See Lawless Spanish.

Does antes de que require the subjunctive?

Yes, antes de que requires the subjunctive:

Por ejemplo …

Antes de que sea muy tarde, debemos salir.
Before it gets too late, we must leave.