How does speciation occur?
Two main ways.
There are two ways speciation can occur. Allopatric speciation refers to speciation due to geological separation, and sympatric speciation refers to speciation without geological barriers.
Allopatric Speciation: This is definitely the most common one, and it occurs a lot when species either migrate to a new place or a physical disturbance happens that impedes travel between two places. For example, allopatric speciation is how the group of mammals we are part of diverged from marsupials.
As the continents split apart, mammals on the Australian and Southeast Asian side adapted to one set of environmental circumstances while those on the African side adapted to another. This led at first to speciation and later to a complete division of the mammal class.
Sympatric speciation: This one's less common, but still occurs a lot. This is where selection or mutation leads to speciation without geological separation. Take a population of ground-dwelling lizards. Perhaps some individuals in the population have longer legs and can climb the trees slightly better, allowing them access to another food source. If natural and sexual selection allow it, they might actually form a new tree-dwelling population, and might even create a new species, even though they're only living a few feet above the original species.