Inversion is the reversal of the normal word order in a sentence or phrase.
There are two types of inversion:
1. Subject-verb inversion, where the subject and the main verb switch positions and the word order becomes verb + subject: On the top of the hill stood an old oak tree.
2. Subject-auxiliary inversion, where the subject and the auxiliary switch positions and the word order becomes auxiliary + subject (+ verb): Hardly had I arrived home when my phone rang.
Inversion happens in English for emphasis, dramatic purpose or formality.
The second type of inversion uses negative and limiting adverbs - these are a group of adverbs which limit the meaning of a verb or make it negative. Examples are never, hardly, no, only, little, nor, scarcely, etc.
Inversion is used to give emphasis or to be rhetorical in more formal situation, in political speech, on the news, and also in literature.
Some native speakers may also use them occasionally in day-to-day conversation.