Recent experiments have revealed a giant “peak effect” in ultrapure high Tc superconductors. Moreover, the data show that the peak effect coincides exactly with the melting transition of the underlying flux lattice. In this work, we show using dynamical scaling arguments that the friction due to the pinning centers acting on the flux lattice develops a singularity near a continuous phase transition and can diverge for many systems. The magnitude of the nonlinear sliding friction of the flux lattice scales with this atomistic friction. Thus, the nonlinear conductance should diverge for a true continuous transition in the flux lattice or peak at a weakly first-order transition or for systems of finite size.