You have a class/module/library "s3sprite". It contains functions inside of it that point to itself and change attributes, like color. "sprite" is an instance of the "s3sprite" class, so when it uses those functions that point to itself, what will it point to? Well, itself: "sprite".
So when you use sprite.setColor(...), what it is doing is telling the object "sprite" to use the function "setColor", and "setColor" simply changes some of the objects attributes. It is as simple as that.
I have never worked with Lua, but OOP should work that same way in general.