They are often used for cooking, such as in charcoal barbecues, and are preferred over open flame when roasting marshmallows on a campfire. This is because embers radiate a more constant form of heat, as opposed to an open fire which is constantly changing along with the heat it radiates.
An ember is usually formed when a fire has only partially burnt a piece of fuel, and there is still usable chemical energy in that piece of fuel. Often this happens because the usable chemical energy is so deep into the center that air (chemically O2) does not reach it, therefore not causing combustion (Carbon-based fuel + O2 --> CO2 + H2O + C + other chemicals involved). The reason that it continues to stay hot and does not lose its thermal energy quickly is because combustion is still happening at a miniature scale. The small yellow, orange and red lights often seen snaking throughout embers are actually combustion. There just is not enough combustion happening at one time to create a flame. By the time embers are completely 'burned through,' almost all of it is pure Carbon with loose physical bonds, which is why they crumble with the slightest touch. At that point they are normally called ashes.
Embers play a large role in forest fires. Since embers are typically burnt leaves and thus small and light, they can be blown away by the wind. During a large fire, with the right wind conditions, embers can be blown far ahead of the fire front, starting spot fires hundreds of metres away. One of the initial stages of defending against a bushfire is dubbed the "ember attack", in which embers will bombard the house, starting small fires in wooden structures.