Nearly every muscle (and joint for that matter) in the body functions through a combination all three planes of movement.The hamstrings and adductors are marvelous examples.
You are correct on the primary functions of the hamstrings in regards to facilitating extension at the hip and flexion at the knee. However, since the hamstrings attach to the pelvis medial to the hip joint (i.e. toward the midline of the body), they are also able to secondarily facilitate hip adduction (i.e. movement of the thigh toward the midline of the body). Additionally, with their attachments across the knee wrapping around each side of the lower leg, they become very important in producing and controlling rotation (i.e. twisting) at the knee as well as at the hip.
The adductors, although named for their adduction function at the hip joint, also contribute to hip function in other planes particularly depending upon the position of the hip at any given moment. When the thigh is extended behind the body, a number of the adductors can actually assist in flexing the hip (i.e. moving the thigh forward). When the hip is flexed (like at the bottom of a squat or deadlift), a number of the adductors act to aid hip extension. The rotational functions of the adductors really kick in when one leg is in front and one leg is behind.
I'm guessing the exercises you are running into the medial hamstring and adductor cooperation with are compound movements like squat and deadlift variations. With these movements, it can be quite interesting to vary foot placement in regards to stance width and even toeing in or out as your body allows without throwing your form off to see what different "feel" you can get from the exercises. My personal favorites for hitting the hamstrings and adductors together are low-bar wide stance squats being sure to push the knees apart over the feet as you descend or a sumo stance Romanian deadlift.
Sorry about rambling on, but I hope this was helpful.
All the best.