The dash is used, rather indiscriminately, for various purposes. It may replace a comma where a stronger break is required. It may be used in place of parentheses, the colon and the semicolon. Often it is used, in a rather informal or conversational style, to drop an interrupting phrase into a sentence.
A dash is not the same as a hyphen. It is used in a different way and it is longer than a hyphen. It may not be present on all keyboards, but you can create a dash by pressing the hyphen along with the ALT or OPTION key. This will give you an en dash (slightly longer than a hyphen). You can create an em dash (slightly longer still) by pressing the hyphen along with the SHIFT + ALT or OPTION key.
An interrupting phrase may be an appositive, an example, or an explanatory aside.
This appositive noun phrase would be just as happy resting between two commas.
Dashes are used to dive emphasis to a final word or phrase of a sentence.
Test your understanding of dash punctuation with the Dash Punctuation Quiz.
These examples were sourced from articles in The Conversation: Why are planets round?; Seeds; Spatial thinking; Gravity; How to avoid distractions; Ultra-processed foods; Why does nature create patterns?; Apex predators; Planet Rings