Solid walls and a thick metal door work to keep heat inside your oven. Yet if you stand beside it while it's turned on, you're likely to feel some of its heat radiating against your body. That's because your oven doesn't contain heat perfectly, which is why it's unwise to leave food in it.
All food, no matter how dry it seems, has some water content. As this water content escapes, the food begins to dry out. In the oven, this results in burning. Left too long, food that burns in your oven begins to smoke and fill the kitchen. If your smoke detector is working, you may be able to remove the food from the oven before it becomes a fire hazard. If it isn't working, or if you aren't nearby to respond to it, you could come home to your home burned down.
Avoid this possibility by using the timer feature on your oven. Some ovens even have a "timed cook" feature that turns off the oven when the timer goes off.
According to U.S. Department of Agriculture guidelines, cooked foods must reach at least 140 F before you can be certain that dangerous organisms can no longer survive. Since your oven doesn't contain heat perfectly, you can't use it to safely store warm foods overnight. Instead, refrigerate the food and reheat it just before eating it.
For some recipes, such as Thanksgiving turkey, it's common to leave the food in the oven for several hours. With turkey, this is necessary to thoroughly cook the meat without drying it out. Such recipes are safe because they require you to cook the food at relatively low temperatures. Nonetheless, never leave food unattended in your oven.
Just as you should never leave home while you have food in the oven, you should never take a nap or do anything else that takes you far away from the kitchen. Check the batteries in your smoke detector at least once a month and replace them every year. This is especially important if you have a large home, since the smoke detector may register a problem before you do.