I always think it's less about the literal age gap and more to do with the emotional age gap. The last time I was single was around this time two years ago, when I was about to turn 23. I was just out of university and looking to find a job so I could move into the next chapter of my life. When I joined all the various dating apps I set the search parameters to women aged 19-25 (three years either side of my age at the time, 22). I matched with a girl who was 19 and we got chatting for a day or two, and she told me she'd was just coming to the end of her first year, and that she'd changed so much and experienced so much in her first year that she was sad to be going home for the summer. In that moment it sort of hit me that, even though there were only three literal years between us, the emotional needs we both required were emotional needs that neither of us could provide.
She was about to undergo serious emotional and personal development at university, I was about to undergo serious emotional and personal development by getting my first full-time job. We were only three years apart in terms of age but we were at completely different stages of our lives, and we both deserved better than what the other person could have provided. I was never going to be able to fully support her during such intense and concentrated transition period. As soon as I realised this, I unmatched without a saying a word and changed my age parameters to women aged 20-24. A week or so later I matched with a girl who was 20 and just coming to the end of her second year at uni, and although the two girls I spoke to were only a year apart in terms of their respective ages, that second year at uni makes all the difference in relation to how much I can offer in terms of emotional support.
At that point I couldn't remember my first year at university but I could remember my second and third (and my masters) vividly. I dated the girl who was 20 for three or four months and we eventually made ourselves exclusive - we'll be celebrating two years together in the near future. There are times when I know I made the correct decision: she's currently undertaking a science-media masters that's connected to the media-science course I studied during my masters. I've been able to support her academically and help her emotionally in ways that I never could have helped the 19-year-old I matched with initially. I think that's why a 40-year-old dating a 31-year-old doesn't seem like such a big gap when a 30-year-old dating a 21-year-old probably does, because the rate of change inevitably slows as routines are established, which means people can often provide a level of emotional understanding for each other when their lives are at similar crossroads.
Or it could be something else entirely. I dunno.