As macOS is POSIX compliant and Unix certified, why does vi redirects to vim? As I understand, vim is not POSIX compliant. So how did Apple obtained a Unix certification without having vi installed on their OS?
It's actually optional.
Per the The Open Group Base Specifications Issue 7, 2018 edition
in the Shells & Utilities Volume, the
vi command states:
This utility shall be provided on systems that both support the User Portability Utilities option and define the POSIX2_CHAR_TERM symbol. On other systems it is optional.