When writing code, it's fairly expected to match any existing indentation on the last line on the newly created one. This will naturally be indentation-style agnostic; it will literally search for prefiing whitespace and replicate it exactly.
The occasional Variation part comes from an attempt to match a wide variety of language semantics with as little code as possible.
If enter is pressed immediately after an opening curly brace ({) or colon (:), indentation will be increased.
If one wishes to clear all indentation after pressing enter, utilize your platform shortcut to do so. For example, on macOS and iOS with an external keyboard, press ⌘⌫ (that is, Command+Backspace).