Yep, It's basically a function that runs different commands based on the file extension.
"ex" I assume is short for "extract". So if you run "ex myarchive.tar.bz2", the script takes the file name and matches it in the case statement, and runs the associated command.
This way you can just run:
ex myarchive.tar.bz2
instead of typing out:
tar jxvf myarchive.tar.bz2
It saves typing, and saves you from having to look up the program and switches that you need every time you need to extract an archive type that you don't already have committed to muscle memory
I hope that didn't make it worse...
-Jeo