Body recomposition works for three groups of people:
Beginners. If you have never trained seriously with weights, your body is primed for rapid change. Muscle protein synthesis is highly sensitive to new stimulus. Even in a slight caloric deficit, beginners can build significant muscle in their first 6-12 months.
Overweight individuals. If you carry excess body fat (above 20% for men, above 30% for women), your body has a large energy reserve it can tap into. You can fuel muscle growth from stored fat while eating at a deficit.
Returning lifters. If you trained seriously in the past but took months or years off, muscle memory is real. Your muscle nuclei remain even after atrophy, and regaining lost muscle happens faster than building new muscle. You can cut fat and rebuild simultaneously.
Recomp is not limited to beginners either. A 2020 review by Barakat and colleagues in the Strength and Conditioning Journal documented simultaneous muscle gain and fat loss in resistance-trained lifters too, as long as training kept progressing and protein intake was high. The catch: the leaner and more advanced you are, the slower it gets.
If you are already lean (under 15% body fat for men) and have trained consistently for 2+ years, recomp becomes extremely slow. At that point, dedicated bulk and cut cycles are more efficient. If you decide to bulk instead, start with a small caloric surplus.