Streaming and setting have no effect on attainment, according to the final batch of research from the most wide-ranging independent inquiry into primary teaching in England for four decades.
The Primary Review, based at Cambridge University, has found that the potential benefits of learning in small groups are often lost because children do not know how to work together.
Methods of grouping classes have proven highly political. The Government's Children's Plan has condemned streaming, in which children are placed into a single group for all lessons, based on overall ability. But it encourages group work and setting, in which pupils are put in different classes according to their ability in particular subjects.
The Conservatives have previously spoken in favour of setting, and recently pledged to make Ofsted ensure that all schools - particularly underperforming ones - set all academic subjects by ability.
Researchers found that heads rarely decided how to group children on the basis of dogma. Instead, decisions were based on how heads believed it would affect learning and teaching, and were tempered by pragmatic concerns such as how many pupils were in school, and what staff and classrooms were available.
The report, by Peter Blatchford, Susan Hallam, Judith Ireson and Peter Kutnick, with Andrea Creech of the Institute of Education and King's College, London, concluded: "The adoption of structured ability groupings therefore has no positive effects on attainment but has detrimental effects on the social and personal outcomes for some children.
"Moreover, the allocation of pupils to groups is a somewhat arbitrary affair and often depends on factors not related to attainment."
Streaming was the most common form of grouping pupils after the Second World War, when it was believed intelligence was largely fixed at birth. By the 1990s, fewer than 3 per cent of primaries used it.
About one in four schools set for maths, and 15 per cent do so for English. Some studies show this benefits children; others show mixed-ability classes are better. An international review found there was no overall effect.
Nowadays, teachers are generally in favour of grouping children by ability within class, and this is the most common practice in primaries.
Researchers agreed with this. "Grouping pupils within the class in different ways for different activities offers more flexibility, facilitates movement between groups structured by ability, and avoids limiting the opportunities for some children," they said. "It would help for teachers to tailor work more specifically to pupil needs."
While grouping can be effective, the researchers found that sometimes it was nothing more than a seating arrangement because children did not work together.
One study found that children felt insecure and threatened when told to work in groups, and teachers were worried that children would disrupt each other.
To make group work more effective, teachers need to help children learn to communicate effectively with each other, and can get research-based guidance on this from the primary national strategy.
They can also get guidance from the SPRinG project (Social Pedagogic Research into Group-work), which was launched by a group of English universities in 2001 after they found that group work boosted results.
It includes activities to help pupils share ideas, shows teachers how to support pupils' work, and gives guidance on seating patterns.
South Farnham Junior in Surrey, a four-form entry school, regularly gets the largest cohort of pupils to level 4 in English, maths and science. But it has never used setting.
Andrew Carter, its head, said: "There is no method of telling who are the ones who are going to be successful. The world is full of people who developed a little later."
Class size is also a political issue. One of the first acts of the Labour Government in 1997 was to introduce legislation limiting key stage 1 classes to 30 pupils.
Despite this, there were still 200 unlawfully large classes in January this year.
Many argue that 30 is too large for a class of five-year-olds. The Liberal Democrats have argued for a maximum class size of 25.
But the Primary Review found there was little research evidence to show class sizes made a difference to pupils' attainment after reception. This was partly because teachers do not necessarily change the way they teach.