Friction is the phenomenon of distributing energy (and momentum). Consider a beads in water. When it moves, because of collisions with water molecules, its energy is transferred to the liquid molecules. All the conservation law are respected, it is just that because you only track your bead, you have the impression that the energy is lost.
The first computation of this phenomena was done by Maxwell in the 1850's ; Boltzmann built a similar approach with the micro-canonic ensemble to establish what we now call the "statistical physics" discipline.