Sorry – there is no ideal size for a team But in a nutshell: “less is more”.
About the specific size of an agile team, there are some ballpoints to remember – Jeff Bezos mentioned the “two pizza team” rule (2 pizzas could feed a team) or the scrum guide recommends something between 3-9 people, so usually less than 10 people.
But what happens if we put more people into a team? There is an interesting blogpost from SQM (see links) quoting a paper which done an extensive research on performance and team size. As a measurement, they took the lines of code (LOC) in software projects. They found out that small teams (3-5 members) show a similar performance as large teams (about 20 people)! The main cause for this effect is for me the amount of communication – it increases exponentially with the team size! And there are many more factors to be considered.
https://www.qsm.com/blog/2012/top-performing-projects-use-small-teams
