Image compression works by reducing the amount of visible information. So whereas the original picture might be able to display 65 million colors, since the eye can not differentiate between anywhere near this number of colors the software is going through and removing colors that are not needed. The actual complexity of the algorithms is far more complex than that, and beyond the scope of this response. But the threshold (assuming I understand your context correctly) has to do with how the algorithm decides what information to throw away and what information to keep, and thus will affect the resulting quality and size of the image after compressions.