The hamstring tendons and muscles run down the back of the thigh connecting the pelvis to the shin bone. They have many functions and are essential for normal walking.
Most people never have to worry about them but some people develop knee or lower back pain if their hamstrings are tight.
When the hamstrings are tight they pull the back of the shin bone up towards the bum. This effectively bends the knee (even if the knee looks straight from the outside. Walking or running on a constantly bent knee places excessive loads on the patella and leads to anterior knee pain.
Stretching the hamstrings is a boring and uncomfortable process which takes many months to achieve. You will need to spend about 10 minutes twice day for 4-6 weeks to notice any improvement in your symptoms. You will also need to maintain a regular stretching programme for many years to prevent the problem from returning.