The gizzard is a specialized part of the digestive tract that is constructed of thick muscular walls where food is ground up. You can think of the gizzard as a gristmill for grinding up the food. And to take the analogy a step further, the grit is the millstone for that gristmill. The gizzard squeezes against the food particles and rubs them against each other and any grit contained in the gizzard. The combined action of gizzard squeezing and the grit, or small stones, rubbing up against the food particles reduces the food to a more digestible size.
The ground up food and digestive juices then move to the small intestine where they are absorbed. The grit goes along for the ride and are eventually excreted through the chicken's cloaca.