As a PhD student I have been part of my fair share of projects where multiple students are competing for leadership and the first-author title of a paper. This is because project PIs often simply ask several students to go off and work on a problem, without any explicit designation of who should lead the work. Authorship is then only determined at the conclusion of the project when the paper is submitted.
While this causes stress, the advantage is that the competition can sometimes force students to push themselves and produce better work to 'outdo' other students. Additionally it can be hard to pre-assign authorship as this can cause non-first authors to be less motivated. And the pre-assigned first author may not necessarily be the most productive student.
As a graduating student who will soon be a PI of my own lab I would rather not create such competitive situations, but at the same time, there will be projects with multiple students that needs motivation. What advice do you have about defining projects in such a way to meet these requirements.