I worked with few developers who refused to transition to the Linux and they were really attached to using git bash. So I had to work out a troubleshooting approach I had encountered this problem before.
In short - mintty has some features that are not compatible with Windows console and when you run a program (sqlite for example) that expects that it will be executed in Windows console - some problems might arise. winpty solves this problem by running the given program in a hidden, native Windows console and forwarding input from the emulator (mintty) to the hidden console and output from the hidden console to the emulator.
I am sorry, but to give you a proper, informative answer to this question I would have to spend some time reading about interworkings of Windows. And to be honest this topic does not interest me.
If the description above is not sufficient please read a bit about TTY and PTY. And then head to the mintty terminal emulator which you decided to use in your instance of git bash (there is a step in the setup of the git bash where they let you decide if you want to use mintty or Windows default console window) and figure out why mintty is not compatible with Windows console. And then google and read the description of winpty, it’s an open-source project so you can even study the source.