An individual may be a Cancer Sun sign, but if he or she has an Aquarius moon, this individual is an emotional Aquarius, and so on. So, while a Cancer male, for example may be a Water Sign, he seeks someone with whom he can relate on an emotional level, and will fit best with someone whose moon is compatible with his. That would be an individual with a moon in Aries, Gemini, Leo, Libra, Sagittarius, or Aquarius.
The moon shows what we are comfortable with, and what it takes to fulfill our emotional needs. It is more difficult to be with someone who cannot fulfill or relate to our true emotional needs. An alternate placement that would create compatibility between two individuals would be a Sun-Moon connection. For example the same Cancer male, mentioned above might be compatible with an Aquarius, as the two would have a Sun-Moon connection. The Sun-Moon connection can be strong as well, as the emotional nature of the moon, would relate to the Sun or the soul vibration of the other individual.
Ideally, both of these combinations would occur in some form, and these are the relationships we tend to think of as soul mates. Generally relationships that do not have a moon connection tend to not work well. Sometimes couples who are in long term relationships do not have compatible moons, but there are always other factors to consider that would create compatibility. Compatibility in intimate relationships is a complex consideration in astrology, and there are many factors to consider.