Antagonistic pleiotropy (AP)
The term for a single gene having effects on multiple traits is pleiotropy (/ply-ot-ruh-pee/). Some genes are antagonistic, meaning they have a positive fitness impact on one trait, but negative for another.
In relation to ageing, natural selection can favour AP genes which are beneficial early in life. It is blind to negative effects in later life, as evolution just has to get you to live long enough to reproduce.
That’s a note for myself. There’s a much deeper treatment in: Biological constraint as a cause of aging.