When I'm sautéing onions, some of them burn while others don't cook enough. I feel like I'm stirring them enough, and I use enough fat, but still, they often come out uneven.
You didn't say what kind of pan you're using, but my guess is that it's not heavy enough and/or does not conduct heat evenly, leaving you with hot spots that burn the onions. If you don't want to get a new pan, try really focusing on stirring constantly
to ensure that no piece of onion hangs out too long in one place.