Only after she'd finished reading the book did she realize who had written it.

Literal

She [topic-は] that book [object-を] finish-reading [then-て] only-after-初めて who [subject-が] wrote [embedded-question-のか] realized.

~て初めて ('only after / not until') is the elegant Japanese construction for 'realized only when X happened' — the action before て is the necessary precondition for whatever realization or change follows. 読み終わる is a compound verb meaning 'finish reading,' built from the auxiliary 終わる ('end, finish'). 誰が書いたのか is an embedded question with の adding the explanatory or wondering nuance, all functioning as the object of 気がつく. Notice how Japanese reverses the English information flow: the realization comes last, not first, building dramatic tension on the final verb.