One contribution of 11 to a theme issue 'Trends and challenges in the mechanics of complex materials' . The pinning of interfaces and free discontinuities by defects and heterogeneities plays an important role in a variety of phenomena, including grain growth, martensitic phase transitions, ferroelectricity, dislocations and fracture. We explore the role of length scale on the pinning of interfaces and show that the width of the interface relative to the length scale of the heterogeneity can have a profound effect on the pinning behaviour, and ultimately on hysteresis. When the heterogeneity is large, the pinning is strong and can lead to stick-slip behaviour as predicted by various models in the literature. However, when the heterogeneity is small, we find that the interface may not be pinned in a significant manner. This shows that a potential route to making materials with low hysteresis is to introduce heterogeneities at a length scale that is small compared with the width of the phase boundary. Finally, the intermediate setting where the length scale of the heterogeneity is comparable to that of the interface width is characterized by complex interactions, thereby giving rise to a non-monotone relationship between the relative heterogeneity size and the critical depinning stress.