So many ways to skin a cat.
For most of the second half of the twentieth century, two year gaps were considered optimal (enough time to really fully recover between births, but close enough to be near-peers). That seemed to work for many and a lot of people still do that, especially now the free hours are more substantial for working parents.
Then pre school funding for three and four year olds came in and most parents were working, so three years became a sensible gap to aim for, and a lot of people did that.
The thing is now that we have IVF, and norw stepfamilies you don’t always get to plan things quite how you’d like. In the case on ivf, that sometimes means you get a baby that years ago you wouldn’t ever have had, but not to your schedule. So I think you see a lot more variation at the school gates now than when I was what at school.
I have a gap of 15 months between the first two and then more than 9 years. So I know that small gaps are chaos in the first couple of years - lots of nappies and hard work - but then the D.C. are at roughly the same developmental stage forever and entertain each other a lot of the time, share friends, are ready for the same museums, films at the same kind of time. Much bigger gaps mean the relative peace of only one preschooler at a time and when you have big gaps like ours, it’s a completely different sibling relationship, a bit more cross-generation but equally lovely with no competition.
I have a friend who swears by 7 year gaps and planned it that way. She thinks it’s best financially and best for sibling harmony, I thought that was brave as she has three, so has gone back to the newborn stage after substantial gaps twice, but she loved it.
So don’t get hung up on one right answer. Even if you have a preference, which is worth thinking about, be prepared for it to go some other way.