It is common that during the stellar evolution one of the stars in a binary system would transfer mass into the the other, resulting in the increase of mass of one star and decrease of mass of the other. Or, if one of the stars happens to evolve through the red giant phase while the other is still on the main sequence, the loss of the mass should be really significant and consequently the orbit should also be changed dramatically.
I have a hard time visualize how the semi-major axis is changed as a result of mass loss. According to the Kepler's third law the semi-major axis a is proportional to $(M_1+M_2)^{1/3}$ but I am not sure whether the period can be fixed or not.