It is confusing until you realize just how different a chicken's digestive system is from other animals.
Basically what happens is that the chicken swallows the food, which goes down the esophagus and into the crop, where it remains for a certain amount of time. From here it moves to the post-crop esophagus and to the "true" stomach, or proventriculus. This stomach functions quite like ours, using digestive enzymes to break down food. After this, the food moves to the gizzard. This is a large organ with thick walls that uses strong muscles to crush and grind food. The grit, and whatever other small stones the chicken ingests, collect here and help crush the food when the muscles do their thing.
However, chickens don't always need the feed store definition of "grit" which comes in the zip-lock packages with the happy chicken on the front. While that stuff works well, if your chickens scratch around in the dirt periodically, they should be ingesting all the grit they will need. Anything from small stones to sand can help the gizzard to function properly.
As adults, chickens rarely need grit unless they are kept away from the ground for long stretches of time. They will find what they need without extra grit. Chicks, on the other hand, may need a bit of help. A chick kept on pine shavings all of its early days will have a hard time immediately digesting green things like grass. At this point they will need some sort of grit to build up their gizzard's "collection." Sand usually works really well for chicks, and it's cheaper than commercial grit.
Well, I've tried to put it in a nutshell, but I think I ended up typing something a little longer!
I hope this helps!