It may be oversimplification, but shell scripting is for combining existing programs to perform new tasks whereas AppleScript is to control (mostly GUI) applications remotely. Classical Unix programs typically read some input and produce some output and shell scripting lets you combine them. AppleScript is to automate GUI applications.