when the elctrons touch the atom it creates electrical friction which generates thermal energy. this gets converted to kinetic energy which makes the atoms vibrate, it becomes more difficult for the electron to flow and slow down. This is resistance.