Under the bark of a tree is a layer caled the cambium, which is the only living part of the trunk. This layer grows, adding new wood to the tree.
A different kind of wood grows during the summer than in the fall. In the summer, the wood grows fast. It tends to be soft and light in color. In the fall, a denser kind of wood grows. This wood is more watertight and prevents the tree from drying out in the winter.
So in many kinds of trees, especially in areas that have harsh winters, each year can be counted with a light area and dark area that go all the way around the tree, forming a ring.