What always confused me on Windows is how shells (e.g. CMD) fit into all of this. You can use pipes, variables, semicolon delimiters etc inside a line, which have to be parsed by the shell before launching any process - and those interact with quoting!
So does that mean the shell first parses a line using its own quoting rules, then launches the processes which parse the line again, possibly using a different set of quoting rules?
This sounds plainly insane.