What gave reptiles and advantage over amphibians?

reptiles have scales (hard skin) to protect them and anphibians don't