Though very simple in mechanics, the little red thing (from now on refered to as the lock) is made up of two parts. The first part is a small metal block that is wedged into the end of the lock, which i couldn't get a picture of that wasn't in shadow.
The second part, which is shown, is a thin piece of metal which protrudes away from the bar. This is the actual locking mechanism. It catches on a lip of the case, thereby making it difficult to remove.