Container.GetAll()
is a function that returns any containers you currently have open.

#
is a length operator in lua

So when you put it all together as #Container.GetAll() it will return the number of backpacks you have open, it then compares this number to the variable NumBackpacks to see if the returned value is less than the value of NumBackpacks. If it is less then it will execute the code inside the if statement, thus opening all the backpacks.