How to deal with favoritism in the lab? I've observed that many PIs are especially prone to having favorite students in their research group, and will treat these students differently than others. Most of the time, this isn't so obvious and doesn't cause problems. However, from time to time, this will be made extremely clear as the time spent on the "favorites" are orders of magnitude more than other students in the lab. This also includes assignments of better projects etc. Of course, I realize that as humans, everyone has favorites, and it is unrealistic to expect manager figures to treat everyone equally. However, I have noticed that in the few groups I've worked in, some PIs will make it embarrassingly clear. For instance, it will often lead to hurt feelings and lost productivity when something essential is not done for one student's project (i.e. read over drafts, provide necessary components of experiments) while the advisor runs to help another student with mundane aspects of their experiment (i.e. actually helping them do the experiments, or spending a lot of time talking with them while telling others they are busy). This is of course common in all workplaces, but I do feel that the advisor/trainee relationship is different in that in many ways the success of the student is very much dependent on the advisor.
An anecdote: my advisor was extremely hands-off for me; we met pretty infrequently and when we met, it was mostly spent on talking about small side issues that came up in my projects. Another student of my advisor had a very different experience. He met extensively with my advisor, he found projects for him to work on (I proposed my own, and my advisor didn't know much of my project until I wrote my thesis). The tension for me reached its climax when my defense date drew near; he told me that he was busy with the other student's thesis and that he will sign mine after he is finished with editing the other student's thesis. He ended up reading my thesis only a couple of days before my defense.

Although this seemed like favoritism, in the end it wasn't. He must have judged me to be an independent and competent researcher, because I got more and better job offers afterwards.

So, there really isn't anything you can do. You should just focus on your own projects, and hopefully your advisor is there when you really can't solve the problem on your own. But if you treat each time that your advisor isn't there as an opportunity to show your competence (whether you think your advisor noticed it or not... it does accumulate!) you'll walk out having become independent, which is an important quality to possess in academia.