Question: As they say, "politics is the exercise of power", and "power is the ability to make things happen in an organisation".
I am working on a project which has some overlap and is partially in competition with other projects. Managers at all levels have different ideas about what should happen. I am trying to understand who is supporting whom, what are the networks I should be aware of, to have a clear idea of where support for our idea might come from.
My line manager doesn't want me to think about politics at all. Other people told me not to be political. But I think these people might have their own agendas - like everybody else. I have seen what happens when you work hard on a project, ignore the politics, and then get backstabbed by some unforeseen person or project.

I do believe that "ignore politics" is bullshit advice: whether you manage people or build things, politics will determine the allocation of resources to your team or project, but I might be wrong.
So, let's ask it this way: **"what are the circumstances when ignoring company politics is good advice?"**

Answer: 
Technically "office politics" *could* mean **important info about who runs the company and how**, as you are interpreting it.

But usually, when people say "ignore office politics", what they mean is to ignore **irrelevant gossip, petty arguments, childish grudges, empty posturing, and such**, that have nothing to do with doing your job (the actual work you are all there to do) and importantly, *can't really affect you unless you participate*. 

Any boss is correct in encouraging any employee to ignore this stuff and focus on their actual work.
Your manager telling you to not think about politics is a political act. Which means he's told you not to think about that advice. You can't follow advice without thinking about it.

Nonsense is never good advice. Ignore this particular advice but don't be obvious about it.