I recently asked a friend why it was not permissible to shave with a regular razor and he said because it destroys the hair follicle. However the follicle sits further inside the skin where no razor not standard or electric could reach. So why is an electric razor allowed and not a regular razor?
I don't think your friend is correct that standard razors are forbidden because they destroy the hair follicle. Proof is that plucking (pulling) hair manually is allowed despite pulling out the follicle (see here and here).
What is forbidden is to shave "the corners of the head and of the beard" (based on Vayikra 19:27: You shall not round off the side-growth on your head, or destroy the side-growth of your beard.) This is understood as cutting hair with a blade (SA YD 181, see here for a translation).
There is indeed a dispute amongst poskim whether shaving is allowed with scissors (see details e.g., here on Halachipedia). So the question to answer for those who allow electric razors, is whether they are closer to a razor (blade) or to a scissor.
Tzomet is an Israeli group of rabbis, researchers and engineers that study new technology in relation to halacha. They explain their position that electric razors are permitted (note that shaver = razor)
There is no discernable difference, from the physical or halachic point of view, between various models of electric shavers. If the "result" is what is important, all types of shavers would be prohibited for use, since none of the shavers leaves hair that can be pulled or that can be felt with the hand.
However, the question of whether shavers can be used is based on the definition of "scissors that are like a razor" and this depends on the mode of operation and not on the result. If the cutting is performed by two or more edges coming into contact, the machine is defined as scissors and not as a razor.
In all the electric shavers, the cutting process is one of contact between a moving blade and the head (a metal screen). Thus, from the point of view of the action performed, these machines are scissors. And this is the basis of our current position.
In our opinion, almost every type of electric shaver which operates as described above can be used.