She's happiest when she's playing the piano.

Literal

She [topic-は] piano [object-を] is-playing time [subject-が] most happy is.

ピアノを弾いているとき ('the time when she's playing the piano') is a verbal clause modifying とき ('time, moment'); the whole noun phrase then becomes the subject of the predicate, marked by が. もっとも is the more elevated/formal partner of 一番 ('most, the number one'), preferred in writing and reflective speech. である is the literary copula — slightly more formal than だ, used in essays, evaluations, dictionary definitions, and reflective prose.