The hamstrings (biceps fermoris, semitendonosis, semimembranosus, some include adductor magnus) flex the knee and extend the hip. The erector spinae and latissimus dorsi flex, extend and rotate the spine .
These muscles don’t directly connect with one another. They are innervated by different nerve roots. As far as we know  they only connect in the brain.
So it’s curious to observe the connection between the minor back strains I get  and my hamstrings. I normally have a good hamstring stretch for my age, but even a minor erector spinae strain will immediately tighten the ipsilateral (same side) hamstring. Improving the back strain is likewise intimately related to stretching the hamstring.
I presume it’s some kind of injury reflex, but I can’t figure out why it’s adaptive.
 Kudos to my all-time favorite medical app, Visible Body’s Human Anatomy Atlas.app, for helping me visualize these areas. It takes a while to learn this powerful app, but it’s worth the time.
 Decades after we thought we understood anatomy we keep learning new things. So who knows :-)?
 There’s a personal history here. I have been mildly surprised how little this history interests other people — including people with disabling back pain. The back strains I get now are more annoying than painful; they are usually related to heavy weights and intense exercise.