You type a hyphen and it becomes a dash, you start a list by accident, or a word jumps to a capital. It is not a bug: these are features trying to help, and sometimes they get in the way.
What changes by itself
- Automatic lists. Typing "1." or a hyphen at the start of a line starts a list.
- Automatic capitals at the start of a sentence or after a full stop.
- Replacements: straight quotes to curly ones, hyphens to dashes, fractions.
- Automatic links when you type a web address.
- Autocorrect of misspelled words.
Undo it at once
Right after the change, press Ctrl+Z (Cmd+Z on a Mac). In many programs the first undo reverses only the automatic correction and keeps what you typed.
Turn it off for good
- Open the program's options (in many, File, Options).
- Find the Proofing or Autocorrect section.
- Untick what you do not want: automatic lists, capitals, replacements.
Names vary by program and language, so look for the words "autocorrect" and "autoformat".
Other reasons formatting changes
- Text pasted from elsewhere. Use paste without formatting.
- Formatting applied by hand instead of styles: see Word formatting basics.
- A different editor reinterpreting the file: the online editor changes my formatting.