While studying Magento I found that the easiest way for me personally to learn something new is to break everything down into smaller parts. This extension is such a "smaller part". It doesn't really add any value and can't be used directly, instead it can help to provide an overview about how a task is accomplished in Magento. See my other repositories for more such example extensions.
This example module adds a free product to the customer's cart if the cart quantity reaches a specified amount of items.
Install using colinmollenhour/modman.
Most of my repositories posted here are projects created for customization requests for clients, so they probably aren't very well documented and the code isn't always 100% flexible. If you have a question or are confused about how something is supposed to work, feel free to get in touch and I'll try and help: info@mobweb.ch.