If it's a Castilian surname, it comes from the word "chaves" meaning "keys". It could refer to someone who lived near a place where keys were made, someone who was a locksmith, or someone who had a key to an important property.
If it's a Basque surname, it comes from the word "txabea" meaning "house" or "dwelling". It could indicate someone who lived in a particular house or was associated with a certain dwelling.
It's important to note that the meaning of a surname can also be influenced by specific family history and traditions. It's possible that the meaning of "Chavez" within a particular family might differ from the general meaning.