(Thanks to @red_menace, @fdo, and @nohillside so far. I've upvoted @red_menace's. It's "correct", but I found it difficult to grasp. I didn't really get it, until I read @fdo's link (first comment) as well. So, I feel this needs a more comprehensive answer for anyone else looking...)
First, it has nothing to do with AppleScript. Instead, in my example in the question:
osascript part can be "any program[/commmand] that can read from standard input (
cat is by far the most common)."**
-- some AppleScript Code part is any number of lines that you could otherwise type into standard input or feed into the "program" from a file, etc.
- In the
<<EOS part, The
EOS isn't special. It's purely the
<< that's key. The
EOS part can be pretty much any single word (ie. string, no spaces or most special characters, etc.)
The result: it will perform the command with the encapsulated text as its input.
In my example,
osascript is simply a shell command that receives AppleScript code as its input and runs that code as if the same code was run in Script Editor, etc.
**Quoted from @fdo's link. See that for more details