How postural imbalance can affect hamstrings
Hamstrings are attached at the bottom of the pelvic bone (sitting bone) and if the center of the body leans forward due to a weak core/hip (1st image), the hamstrings are placed in a shortened position. Then, the muscle gradually gets tight, which will pull the tendon away from the bone. This mechanism is one of the main causes for tendon problems.
In addition, the glutes cannot function properly in this position (See the below video from 03:55). As a result, the hamstrings have to compensate, contributing to overload the tendon.
The second body feature is that the center of gravity is tilted to one side, as shown in the picture above. In the case of this woman, her weight is shifted to the right, and in this case, the outer branch of her right hamstrings and the inner branch of her left hamstrings will be placed in a lengthened position. This naturally weakens muscle function and overloads the muscles.
On the other hand, the inner branch of her right hamstrings and the outer branch of her left hamstrings will be placed in a shortened position. Then, the muscles gradually become tight, which will decrease its function as well. Therefore, whether the muscles are shortened or lengthened, muscles that are out of their neutral position do not function properly and are more likely to cause problems.
Finally, the third physical feature that can put stress on the piriformis is pelvis rotation (3rd image). This man's pelvis tends to rotate to the right when he is completely relaxed. Now the left side of his pelvis moves forward and the right side relatively moves backward.
Then, the outer branch of his right hamstrings is likely to be placed in a lengthened position. This increased tension in combination with twisting force will be more harmful on the tendon itself.
Having these body characteristics does not necessarily mean that it always causes a problem, but consider this as a contributing factor and make sure to do a program that balances your whole body.