When Europeans encountered these animals in South America, they adopted the Tupi word, which eventually evolved into "cavy" in English.
So, while "guinea pig" is the more common name, the word "cavy" is a direct link to the animal's original South American origins.