Two important things determine the Earth's climate. One is the amount of heat the sun delivers to the Earth. Also important is where the Earth's continents are located relative to the equator. Continental ice sheets cannot develop unless one or more continents are located at high latitudes.
The Earth revolves around the sun once a year. The orbit is almost a circle. If the Earth were the only planet, its orbit around the sun would be almost unchanging. The other planets exert a pull on the Earth. Although the pull is small, it makes the Earth's orbit much more complicated. The orbit changes slightly in several different ways. The changes occur over periods that range from about twenty thousand years to about a hundred thousand years. These changes cause slight differences in how much of the sun's heat the Earth receives, in winter vs. summer and at high latitudes vs. low latitudes.
The astronomical theory of the ice ages holds that the small changes in the Earth's orbit trigger the advance and retreat of ice sheets. Most scientists now accept this theory. The details of how the changes trigger the ice sheets are still only partly understood. For example, the very fast melting of the ice sheets, compared to the long times needed for them to form, is still a mystery.
The astronomical theory is only part of the story. Climate is known to change on time scales as short as centuries, and the cause (or causes) of these changes are still not clear. Here's a big question, and an important one. Has the increase in temperature since the beginning of the twentieth century been caused by human activity, or is it just another natural upward "spike" like several during the past two millennia? Most climatologists think that the upward trend in temperature during the twentieth century is at least partly caused by human activity.