Cells know how to differentiate through a process called gene expression. It’s a specific combination of genes that are turned on and off.
Species could compete for water, food, land, etc.
On one side of the grand canyon could be a squirrel with a birth defect witch reproduses with a squirrel with normal genes. But the birth defect is stronger than whatever trait that may be. so the litter of squirrels mostly have this trait. and the cycle contiues