After the impurities were removed from the grain, it was ground to make flour. The melacha of tochein (grinding) involves breaking something down into smaller pieces, thereby making it useful for a new purpose. For example, while slicing vegetables is permitted on Shabbos, dicing them into small pieces may violate the melacha of tochein.
Tochein can apply to wood, stone, metal and other substances. Scraping dried mud off of one’s shoes, causing it to crumble is prohibited because of tochein. When it comes to food, however, tochein only applies to items that grow directly from the ground – basically, produce. Accordingly, cheese, meat, fish, etc. may be chopped very fine, though one may not use a utensil specifically designed for this purpose. (Chopping raw meat would violate tochein as it is inedible in that state and therefore considered a non-food item.) There are those authorities who permit mashing such foods as potatoes (again, not using a utensil designed for this purpose) on the basis that it forms a single mass rather than individual pieces; others prohibit this. (Ask your local halachic authority for guidance.)
As with some melachos, such as boreir (Melacha #7, above), one effectively accomplishes this act through the eating process. Accordingly, one is also permitted to chop something up just prior to eating it.
The melacha of tochein is the reason that medical treatments are not permitted on Shabbos for simple discomforts. Preparing medicine entails grinding – even today the mortar and pestle is a symbol of a pharmacy. For more severe illnesses, there is an increasing scale of permitted activities, far beyond our scope to address. Additionally, one may take maintenance medications that must be taken daily in order to be effective.
There is no particular size that determines when something steps over the line into violating tochein. Accordingly, when chopping something up on Shabbos, such as vegetables for a salad, it is advisable to err on the side of caution and make the pieces somewhat larger than usual.
This is just an introduction to the concepts of the melacha of tochein; it is not a substitute for a full study of the halachos.