"Spacing around an em dash varies. Most newspapers insert a space before and after the dash, and many popular magazines do the same, but most books and journals omit spacing, closing whatever comes before and after the em dash right up next to it. This website prefers the latter, its style requiring the closely-held em dash in running text."

The Em Dash in Action: A New Direction

Em dashes are used in place of commas or parentheses to emphasize or draw attention to parenthetical or amplifying material. In this particular task, em dashes occupy a kind of middle ground among the three: when commas do the job, the material is most closely related to what’s around it, and when parentheses do the job, the material is most distantly related to what’s around it; when dashes do the job the material is somewhere in the middle.

extra love for the extended pastry example throughout these sample sentences

The Em Dash in the Company of Other Punctuation Marks

"A Hyphen Can Be Considered to Be a Kind of Dash"