You have the option to add products to either parent or sub-categories, or both. When you update the product, use cntrl+click to select both the parent category and the sub-category from the categories list. They do not automatically appear in the parent categories if they aren't specified to appear there.