I think sometimes it’s also up to the person. Some people mature physically and mentally earlier. Plenty of 18 year olds have the mental and even physical maturity of a 14 year old and some 16 year olds are probably a bit mature.
It’s not exactly like the day they are 18, they are adults. It’s really about the dynamics of the relationship. A 32 year old man with a 14 year old girl is probably inappropriate because the power dynamics skew too heavily to the man and it’s basically taking advantage of someone vs a mutual partnership.
Where as 17 and 22 isn’t always so far off mentally and physically and can establish a mutual relationship. Although I have to say, 16 and under is too young for an person past college for that to be a healthy relationship.