Script compressor wav to ogg technique

Hello,
This days am working on a multimedia project and am looking for script compressor wav to ogg, also i want to ask if in case of compressed wav or other format to ogg will this effect on the quality of the audio file?
I will be thankful if anyone can explain to me in general how this compression works, am interesting in knowing the technique.
