We are so accustomed to the thought of a ham as consisting of that part of the upper leg which includes thigh and buttock as to forget entirely that this is, literally, an extended meaning.
Originally the ham of a man or beast was only that part of the leg directly back of the knee.
The ham strings were (and still are, though now united into hamstrings) the tendons at the back of the knee, or in an animal, the great tendon at the back of the hock.
To be hamstrung is to be disabled or crippled through the severing of a hamstring.