There are two types of electric stoves, but they both have the same basic function. The less modern type has hot-plate-style heating coils. The newer type has a glass-ceramic cooktop, which has very low thermal conductivity. This cooktop can be less safe, as the burner areas don't change color when heating (unlike the coiled style).
Electric stoves are powered by electrical connections. The burners are heated by surface heating elements connected to a power source. When the stove is turned on, the electricity begins to flow between the power source and the surface heating elements, and the burners heat to the desired temperature almost instantly.
Gas stoves are fueled by an external gas line that feeds directly into the stove via a series of pipes. When the stove is turned on, gas travels through the pipes in the stove. While in these pipes, the gas mixes with air, which allows the gas to produce a blue, easily controllable flame when lit. About halfway down the line, a small pipe branches off the main gas line. This pipe leads to the pilot light, a small flame that always remains lit. The pilot light ignites the gas in the small pipe, and the flaming gas travels back down that pipe to the main gas line. That flame ignites the gas in the main line, and the flame travels to the burner. The size of the flame is controlled by the amount of gas traveling through the main line.
A variety of temporary stoves, including hot plates and camp stoves, are available for portable use. These stoves can be used in dwellings that don't have a traditional kitchen or while on a trip where modern conveniences aren't available. Hot plates are generally electric coiled burners that are contained on a heatproof, tabletop stand. When plugged in, these burners heat similar to an electric stove. Camp stoves are generally gas-powered and hooked up to propane tanks. When in use, the propane tank's gas valve is opened and the gas flowing through the burner is ignited with a match or lighter.