Egg groups are used to match up certain pokemon with another to make an egg. For example:
Both of these pokemon belong to the fairy egg group-
Pikachu (female) Cherrium (male)
Outcome: Pichu
(if you have the pikachu hold a light ball, the pichu will know volt tackle)
Hope this helps :)