A character encoding defines a mapping between a code point (an integer number) and a character.
ANSI is a generic term for an 8-bit character encoding that is based on ASCII.
Let's look at a Windows API function to see how ANSI strings are used.
MessageBox(string text, string caption)
Before windows supported Unicode, there was only one version of MessageBox. The version above that takes an ANSI string. An 8-bit string. Since we don't pass a codepage to the function, Windows has to assume that the strings 'text' and 'caption' are encoded with the current codepage. This is a sensible optimization.
When Microsoft added support for Unicode, all functions that take a string were split in two. We got an ANSI version for backwards compatibility, and a WIDE version for Unicode.
MessageBoxA(string text, string caption)
MessageBoxW(string text, string caption)
The Windows API contains thousands of functions like MessageBox, which is why, within Microsoft documentation, the term ANSI became a synonym for an 8-bit string.