Lessons from the fossil record: the Ediacaran radiation, the Cambrian radiation, and the end-Permian mass extinction