Some bakers use both butter and shortening to capture the best qualities of each, but I prefer to use all butter. Enough fat should be used so that it is able to coat the flour which will produce a tender crust that is neither tough nor greasy. The smaller the proportion of fat, the greater the development of gluten when water is added. Don't use reduced-fat products in your pastry recipes. Their characteristics come from a high fat content.
Fats also contribute to the flakiness of pastry by separating the dough into layers.
Margarine can be used, but I prefer the flavor of fresh unsalted butter. Cold butter is layered in between the layers of thin dough which melt during baking and leave air spaces. This results in flaky and tender pastry. Because butter has such a low and sharp melting point, it must be well-chilled to ensure that it can withstand being rolled and handled without melting. Sweet pastry recipes, which call for mixing in a food processor, often use frozen butter so it won't melt, as heat is generated by the speed of mixing.