That's not actually true, at all. The tightest bonds of collaboration are usually within a team, and the next tightest are between a product team and its users. It's not unusual for a department to take its users' side
against the rest of the same corporation, like for example when Google Search levied an SEO penalty against Google Chrome, or how Google PageSpeed marks many Google sites as slow.
It's also not unusual for organizations to collaborate on one aspect and compete on another. On one hand, Google is in fairly tight with the Obama administration, with the HealthCare.gov rescue & USDS being largely led by ex-Google and ex-Twitter engineers on temporary leave. On the other, all the tech companies banded together to encrypt everything when they found out the NSA was snooping on their wire links.
I used to believe as you did, dividing big entities up into "government" and "corporations", but then personal experience in a big corporation and a lot of friends in government showed me that this is not at all how the world operates. Ultimately it's a lot more chaotic, and the default state in most relationships is "frenemy".