Purple stem plants can be formed by genetics, they use their energy slightly different from other plants, they use less energy, but that may also be because of bad nutrition, and because they may be hungry for nutrients.
It gains or loses electrons to become like the Noble gases having 8 valence electrons to become the most stable.