Form and rules
How it works
After fronted never, rarely, seldom, hardly ever, little and under no circumstances, invert auxiliary and subject: Never have I seen....
If the original clause has no auxiliary, add do/does/did: Rarely do we receive complaints.
Not only at the front triggers inversion in its clause: Not only did she apologize, but she also refunded us.
Hardly/scarcely...when and no sooner...than often use past perfect inversion for events in rapid sequence.
This is marked/formal emphasis; ordinary word order remains more natural in everyday neutral statements.