Microscopic theory of electron absorption by plasma-facing surfaces