How does one stay out of it ?
If you have good management and leadership it helps and if not then it becomes every man for himself and having allies will mean squat!
I realized long ago that it's a waste of energy and yet it's difficult to avoid if you are embedded in the social fabric of the company.
Remaining neutral is difficult when you know you will get drawn into it by consequences.
Best advice is Aim to get along with as many of your colleagues, forget the barriers of rank, division and language preference even (I'm not kidding); if you can speak Singlish, it's not impossible.
Keep your nose clean and work at your task.