The SSH server has to figure out how to deal with it, most SSH servers to my knowledge invoke a shell. Parsing the passed command and trying to invoke it without a shell can be unsafe as escaping is shell-specific. (Imagine, for example, SSH'ing into a Windows machine, which the protocol entirely supports.)
[1] https://datatracker.ietf.org/doc/html/rfc4254#section-6.5