We investigate how to efficiently set up work groups to boost group productivity, individual satisfaction, and learning. Therefore, we conduct a natural field experiment in a compulsory undergraduate course and study differences between self-selected and randomly assigned groups. We find that self-selected groups perform significantly worse on group assignments. Yet, students in self-selected groups learn more and are more satisfied than those in randomly assigned groups. The effect of allowing students to pick group members dominates the effect of different group compositions in selfselected groups: When controlling for the skill, gender, and home region composition of groups, the differences between self-selected and randomly formed groups persist almost unaltered. The distribution of GitHub commits per group reveals that the better average performance of randomly assigned groups is mainly driven by highly skilled individuals distributed over more groups due to the assignment mechanism. Moreover, these highly skilled individuals contribute more to the group in randomly formed groups. We argue that this mechanism explains why self-selected groups perform worse on the projects but acquire more knowledge than randomly formed groups. These findings are relevant for setting up workgroups in academic, business, and governmental organizations when tasks are not constrained to the skill set of specific individuals.