There is no "Linux" within macOS. Technically Linux is just a Kernel Module used to provide system drivers to communicate with the hardware of the device to allow the booting of a device so that actual applications such as text editors & web browsers can be used by a person. Even if you consider Linux to be a full fledged operating system or distribution, then it would either be running within a Virtual Machine on top of macOS (you would need to install both), or you would need to install a Linux distribution onto another partition or drive so you can dual boot the computer.
There may be lots of open source software within macOS which may have originated from Linux users or one of the other open source operating systems such as FreeBSD, etc., but they are not Linux. Plus some open source software may have been first developed on a Windows system, then later modified to run on other operating systems.
Anything that is included by Apple within macOS from the factory will automatically be patched & updated to address any bugs or security issues. When a major OS upgrade is performed (such as going from macOS 13.x to 14.x), then some apps & utilities may receive newer versions which may contain more features (sometimes features may be removed as well).
Zsh is just one of the command line shells macOS includes and is patched & upgraded the same as any other software or applications included with macOS by Apple.