For a new species to form, first 2 groups of animals or plants must become physically spearated to form 2 different groups.
Each group will have genetic variation within the group meaning that there is a wide range of alleles to control the characteristics of the individuals in the group.
some of these alleles will be advantageous and help the individuals with these alleles survive. Therefore, thse individuals will be able to reproduce and pass on these alleles to their offspring. This is called natural selection.
Over many years, the 2 different groups will select for different alleles and so become so genetically different that they will no longer be able to interbreed with each other and so are now separate species.