My table mate and I have two different but good thoughts on grouping in class.
Strategy 1: Students do an independent assignment for one class, but they are allowed to sit wherever they want and with whomever they want. While they work, the teacher observes who is doing a good job and not doing a good job and assigns groups accordingly. This prevents surprises after it is too late. Students that naturally work with others are likely friends, and if they are grouped together, they are more comfortable and likely to work together successfully.
Strategy 2: Students are going to have to work with lots of people whether they like them or not. The teacher classifies students into groups based on mixed ability grouping (high/medium/low), not generally worrying about whether students are with people they’re friends with or not. If students are concerned about who they’re put with, they can meet with the teacher to discuss concerns, but ultimately teachers do not make changes to the groups, but instead work with the students to figure out how the students can be successful working together.