From the git documentation:
*core.editor*
*By default, Git uses whatever you’ve set as your default text editor via
one of the shell environment variables VISUAL or EDITOR, or else falls back
to the vi editor to create and edit your commit and tag messages*
https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
It seems that many people leave their default editor undefined so git opens vi for commit messages by default. vi tends to be symlinked to vim on many systems so that means they end up in vim (not that it makes a difference, I'm just being pedantic :).