Inherited from Old Spanish vejez. By surface analysis, viejo (“old”) + -ez.
Practice speaking and memorizing "vejez" and many other words and sentences in Spanish.