how does electron flow work