Why does ostrich and other birds like pigeon swallow stones?
Birds do not have teeth so stones help in the process of grinding food.

Before even going to the stomach the food it starts to be processed in the "Crop". However is in the "Gizzard"  that the stones play a big role helping this muscular sack to mince and grind the food (the link sends you to an image of an open gizzard with pebbles inside). 

Food and stones are present at the same time into this organ, therefore during peristaltic and contraction movements the friction between stones and food allow more efficient grinding.



Here you can a detailed description of the chicken digestive system that can be largely applied to birds in general.