In BGP, MD5 authentication sets an MD5 authentication password for a TCP connection, and is performed by TCP. If authentication fails, no TCP connection will be established.
Keychain authentication needs to be configured on two devices that establish a BGP peer relationship. The encryption algorithms and passwords for keychain authentication on both peers must be the same. This allows the peers to establish a TCP connection to exchange BGP packets.