It is about ID numbers
Breeding rate
Same species, different ID numbers
The chance of getting an Egg is 69.3% (has a value of 70). The old man in the Day Care will say: "The two seem to get along very well."
Same species, same ID numbers
The chance of getting an Egg is 49.5% (has a value of 50). The old man in the Day Care will say: "The two seem to get along."
Different species, different ID numbers
The chance of getting an Egg is 49.5% (has a value of 50). The old man in the Day Care will say: "The two seem to get along."
Different species, same ID numbers
The chance of getting an Egg is 19.8% (has a value of 20). The old man in the Day Care will say: "The two don't seem to like each other."
Different Egg groups, same genders or Undiscovered group
The Pokémon are incompatible and therefore will not make an Egg. The old man in the Day Care will say: "The two prefer to play with other Pokémon than each other."
From: http://bulbapedia.bulbagarden.net/wiki/Pokémon_breeding