Scientists say they figured out how the fossils of dozens of different dinosaurs, birds and early mammals ended up in a lake bed in northern China.