Why was an oven invented?

so people could heat and cook food without going and gathering wood all the time and also they could cook in the comfort of there home.