Optical and tube compressors differ in the circuits used to control the way that gain is reduced. With optical compressors, a photo-optical detector circuit controls how much gain will be reduced. These types of compressors can be made with very few components, so the signal path can be very clean. Because of this, optical compressors generally sound very transparent.
Tube compressors achieve compression by re-biasing the tube to control the gain reduction. This characteristically imparts a warm smoothness and slight harmonic distortion to the sound. In other words, tube compression does change the sound more noticeably than optical compression, but sometimes that’s just what the doctor ordered.
Note: there are also optical compressors that use tube circuits for makeup gain; in this case, this is different from a tube compressor where the vacuum tube is doing the actual gain reduction.