This is an example of
parameter substitution. The syntax here is
which means
remove from $var the longest part of $Pattern that matches the front end of $var.
In a pattern the asterisk means any sequence of characters (zero included). In your example all the characters before the last underscore and the underscore itself are removed, leaving I or U as required.
You can find a detailed description of parameter substitution, along with a lot of examples, in the Advanced Bash Scripting Guide,
here. A pdf version of this document is also available.