Egg Groups determine what Pokemon can breed with what Pokemon. In order for two Pokemon to breed, they must be opposite genders and have at least one matching Egg Group. The one exception to this is Ditto, who can breed with any Pokemon in any Egg Group, excluding the Undiscovered Egg Group. Pokemon in the Undiscovered Egg Group, for example, all baby Pokemon, cannot be bred with anything, including Ditto and other Pokemon in the Undiscovered Egg Group.
Source