Historically, the command line interface provided a way to manipulate a computer over simple, text-based connections. In the modern era, in spite of the ability to transmit graphical user interfaces over the Internet, the command line remains a powerful tool for performing certain types of tasks.
The command line is one of the interfaces to macOS, in addition to the more familiar graphical user interface.
The command line is a quite powerful and cryptic approach to managing and troubleshooting a Mac.
macOS shares much with Unix, and Unix was originally used, managed, and maintained from the command line.
Various different command line environments are available on or available for macOS, and bash and zsh are two of those choices.
The command line can be used to script various operations, as well as other tasks.
If the graphical user interface does what you need, there’s no need to learn about the command line.
If you do want to learn more, there are various resources available.
Apple has available a command line primer, and that is the source of the above quote.