Ok, say you have a bunch of strings with thing associated with them. In this case it's texture names and image ID's. Say we have a list, something like this:
"grass" 5
"water" 2
"wood" 1
"rock" 3
"cement" 4
Now something comes along and says to draw cement, and we need to figure out what texture id "cement" uses. The way quake2 does it is string compare each texture:
Is "cement" "grass"? no
Is "cement" "water"? no
Is "cement" "wood"? no
Is "cement" "rock"? no
Is "cement" "cement"? yes. Ok, the id is 4.
I'm sure you can see why this causes slowdown. (Fortunately it isn't actually on all the textures, just the HUD images, really).
Now, if we put everything in a table and use some algorithm to reference it, you can avoid checking every single thing in the list. Say we use the first letter in the name as an array index:
[1] -
[2] -
[3] "cement" 4
[4] -
...
[7] "grass" 5
...
[18] "rock" 3
...
[23] "water" 2, "wood" 1
[24] -
[25] -
[26] -
Now you can just grab the first letter of "cement," get the index 3, check if "cement" is there, and you've got it.