Some applications build and run operating-system commands using user input, for example a network tool that pings an address you type. If the app passes your input into a shell without sanitising it, you can append your own command using shell metacharacters, and the server runs it with the privileges of the web application.
This is one of the highest-impact web flaws because it moves the attacker from the application into the underlying operating system. From there they can read sensitive files, enumerate the host, and often work toward a full shell. The root cause is the same as SQL injection: untrusted input reaching an interpreter, here the shell, without separation between code and data.