It's a simple matter of terciles and life expectancies. Average life expectancy in the post-industrial world is about 80 years. Dividing that into three equal categories, you get (roughly) 0-26 = young age, 27-53 = middle age, 54-80 = old age. Of course with increases in life expectancy (and to make the math easier), you could use 30-59 as the middle group, and save a bunch of late-20s people the anxiety of already being "middle-aged", but it's still a bit silly how that term has become (in some people's minds) a euphemism for "old".
(And for the record, I'm 49: very accustomed to being "middle-aged".)