This chemical reaction explains why every method of preparing garlic tastes different. If you use a sharp knife and cut garlic into thin slices, you'll get less allicin and once you cook the garlic, it will be more sweet. The sharp knife doesn't crush as much of the garlic's cell walls. If you crush garlic in a press, the chemical reaction happens at just about maximum speed, and you get a very pungent garlic flavor.
This chemical reaction evolved as a defense mechanism against animals who would eat the garlic bulb. Bulbs in the same family--onions, garlic, shallots, scallions, etc--basically engage in chemical warfare. Humans (and certain other animals) have a number of adaptations which allow use to eat these foods anyway.