She passed the exam.

Literal

She [topic-は] exam [target-に] passed.

The set collocation 試験に合格する uses に to mark the exam as the target of passing — analogous to 'pass on / succeed at' rather than 'pass through.' 合格 (literally 'meet the standard') is the formal Sino-Japanese verb for passing an exam, certification, or audition. Compare with the more colloquial 試験に通る ('get through the exam') and the negative counterpart 試験に落ちる ('fall on the exam' = fail).