These mass flows occur because one of the stars, in the course of its evolution, has become a giant or supergiant.
In binary stars the heaviest star generally is the first to evolve into a giant or supergiant.