there are a lot of different things going on there! You need to know about the xbmc http api commands to know about the command GetVolume()
then you need to know what is being returned (you can see this by mousing over the command history for the action that sent the getVolume command.
then you need to know a bit about regular expressions. We use regular expressions to extract the volume because xbmc is returning extra text that we don't want.
then we show the info. If you look at the "what artist is this" commands you will see that they work basically the same way.