There is not one single mechanism to explain how flames work on an electric fireplace. They usually employ a combination of techniques to make the flames look realistic. Some may use LED lights, while others might use rotating mirrors. Many use a combination of the two.