My understanding: It's not necessarily whether the overall reaction is endothermic or exothermic. It's whether the step that controls the selectivity is exothermic or endothermic. Often the step that controls the selectivity involves formation of two different reactive intermediates, for example two different carbocations. Since formations of the carbocations are endothermic, the transition states leading to the carbocations also resemble the two possible carbocations. So one is a "secondary" transition state and another is a "tertiary" transition state. So the relative rates of carbocation formation reflects their relative stability.