The two factors most likely to affect whether a galaxy will evolve by merging with a second galaxy are:
-
Its distance from the other galaxy - The closer two galaxies are to each other, the more likely they are to experience gravitational interactions that can lead to merging.
-
Its size compared to that of the other galaxy - The relative sizes (and masses) of the galaxies can influence their gravitational attraction and the dynamics of their potential merger. Larger galaxies can more easily gravitationally attract smaller ones.
These factors play significant roles in the likelihood of galactic mergers.