Flat electronic bands, characteristic of ‘magic-angle’ twisted bilayer graphene, host many correlated phenomena1,2,3,4,5,6,7,8,9. Nevertheless, many properties of these bands and emerging symmetry-broken phases are still poorly understood. Here we use scanning tunnelling spectroscopy to examine the evolution of the twisted bilayer graphene bands and related gapped phases as the twist angle between the two graphene layers changes. We detect filling-dependent flattening of the bands that is appreciable even when the angle is well above the magic angle value and so the material is nominally in a weakly correlated regime. Upon approaching the magic angle, we further show that the most prominent correlated gaps begin to emerge when band flattening is maximized around certain integer fillings of electrons per moiré unit cell. Our observations are consistent with a model that suggests that a significant enhancement of the density of states caused by the band flattening triggers a cascade of symmetry-breaking transitions. Finally, we explore the temperature dependence of the cascade and identify gapped features that develop in a broad range of band fillings where superconductivity is expected. Our results highlight the role of interaction-driven band flattening in defining the electronic properties of twisted bilayer graphene.