I'm usually thinking about having the correct amount of lands to cast all the main spells in the game at the correct time. Too little lands and I have to wait an extra turn to cast my spells, too many and I have too few spells to cast. The average cmc is a good starting point but it's only half of the story. My Manaless Dredge has no lands at all and it's working pretty fine
As an example: my Heroic deck is a straight, classic and simple mono-W and has a low mana curve, so I need 3 lands on the board at turn 3 to play everything. At the beginning of turn 3, I'll see 9 total cards (7 in hand + 1 turn 2 + 1 turn 3) and statistically I want that 3 of them are lands: 3/9 = 0.33. So 33% of my deck has to be lands (20 out of 60 cards). If I'm starting second, then I'm gonna draw one card more, increasing the chances of an extra land.
On the other hand I have a Pirate deck where the highest cmc is 4, so ideally I'd like to statistically have 4 lands on turn 4 (4/10*60 = 24 lands out of 60 cards).
Another aspect is how much colorless mana is required. My Selesnya deck is absolutely horrible regarding this: most of the cards require both {G} and {W} to be casted and this definitely increases the mana requirements for the deck. My Vehicle deck, on the other hand, has a lot of colorless cards and it's quite versatile on this aspect, so it can run with fewer lands than the ideal number.
I also suggest to check this online tool: https://mtgcalc.shinyapps.io/manacurve/
This is an interesting way of thinking about it, and for lower cost decks this sounds like a good idea. But decks with higher upper ranges (for instance, I have a jank 60-card deck based around
Nicol Bolas because it's funny) probably don't want to have 8 lands out of 15 cards. Card draw is also a factor that has to be taken into account.
I'd say for the most part you want between 22 and 24 lands overall in a deck. More than that just feels like overkill, unless you have a *ton* of card draw.