Heat (energy) tends to flow from warmer toward cooler areas. During heating season the heat wants to flow from the inside of the house to the outside air or soil. During the cooling season the outside heat flows to the cooler interior. (If you want to sound smart, you can say this is evidence of the “Second Law of Thermodynamics.")
The purpose of insulation is to SLOW DOWN the movement of heat -- no matter which direction the heat is trying to move.
With better insulation, during heating season your home will lose heat more slowly, meaning that your furnace (or heat pump) needs to use less fuel (or electricity) to maintain the desired inside temperature.
The same principle holds true during cooling season, but the unwanted movement of heat is from the outside in.
Building materials are is classified by how well they slow down the flow of heat. The higher the "R-VALUE," the better it slows down the movement of heat.
The wood framing of a home has a R-value of about R-1.25 per inch. A half-inch layer of drywall has an R-value of about R-.45.
Fiberglass is the most common home insulating material – it’s used to fill stud cavities in outside walls, between the joists in the bottom of an attic space, and in floor joists over any unheated space. Fiberglass has an R-value of about R-4 per inch.
Standard walls have a 3-1/2" thick cavity (the thickness of a 2x4 wall stud). Fill the cavity with standard fiberglass insulation and you get R-13. Factor in the drywall, the exterior sheathing, and the siding, and you might have an overall R-value of R-15 or so.
In colder climates building codes now generally require 5-1/2 inch framing (using 2x6 studs) to make enough room for R-19 of fiberglass insulation.
And the technology of fiberglass insulation is improving. High density fiberglass is available which provides R-15 in a 2x4 stud cavity and R-21 in a 2x6 stud cavity.
Of course, there are parts of the walls with lower R-value. Heat flows more easily through the wood studs, and it flows very easily through glass in windows. (That is why, depending on your climate, upgrading your windows with double-paned glass panels can generate a quick payback in lower heating costs.)