Deadly outbreaks have plagued societies for centuries. But they can lead to medical breakthroughs—if we learn the right lessons from them.