The gap theory is the view that God created a fully functional earth with all animals, including the dinosaurs and other creatures we know only from the fossil record.
The theory goes, something happened to destroy the earth completely-most likely the fall of Satan to earth-so that the planet became without form and void.