It is about the conservation of the mechanical energy. The state of energy of a system can increase by receiving work = Force*distance or it can decrease by dissipating energy through friction (converted in thermal energy). In imagine at point A the total energy is U1 = beer_mass*g*h since vA = 0 . The the beer is accelerated by the total force (Fapp-Friction), that produces work (Fapp-Friction)*dAB. At point B the energy = U1 + K2 , where K2 = 0.5*beer_mass*
vB^2. At point B the Fapp becomes =0 and only the Friction force change the energy state from K2 +U1 (at point B) to U1 at point C. The friction work=Friction*dBC = -K2.
Same logic at point C' the energy U2 = U1 + beer_mass*g*delta_h and the travel is shorter, part of the kinetic energy is changed into potential energy (the work of the gravity component acting on the same direction as the Friction force)