# ELI5: The logic behind tree building

I'm studying trees for the first time and I got stuck on a theoretical passage: on ISLR (Hastie, James, Tibshirani, Witten) I found that considering that: $$\sum_{j=1}^{J} \sum_{i\in Rj} (y-\hat{y}_{R_{j}})^2$$ minimizes the RSS, this formula would be the best one for finding non-overlapping regions. However it has been stated that such an approach would be np-hard, hence a greedy-approach should be preferred.

My point is: how exactly do we find the regions? Considering that I have $$X_{1}, X_{2},...,X_{p}$$ predictors, how to split the space into $$R_{1}, R_{2},...,R_{j}$$ regions? What's the theoretical intuition?