The manga, which I've read only recently, includes a notes section at the back where the author not only gives background, but explains the ground, since the plotting is even more tangled and inscrutable than in the film. Masamune Shirow is a very frustrating guide to his own creation, coming across as an excitable autodidact who mashes and remixes a heap of memes but who's ability to synthesise and explain his arguments has gone AWOL. Part of the problem may be that he lives in his world so deeply that he assumes the reader already understands most of it. The notes are fascinating nonetheless, particularly when they leave behind all the talk of cybernetics, "ordinance and equipment" and start to cover the concept of ghosts and the influence of religion on his work:
"I think all things in nature have "ghosts". This is a form of pantheism, and similar to ideas found in Shinto or among believers in the Manitou. Because of the complexity and function, and the physical constraints they have when they appear as a physical phenomenon, it may be impossible to scientifically prove this. There are, after all, humans who act more like robots than robots, and no one can say for certain that they have no ghosts just because they don't act like it. In ancient times, neither air nor the universe were believed to exist."
I've included wikipedia links in the above, and only a brief scan will confirm that these are vastly different traditions Shirow is referencing here. What's clear is that he believes in a kind of cosmic ordering in which spirits can influence our lives. This carries over into the anime: the Major sometimes hears "whispers" in her ghost, a preternatural intuition that tells her which car to tail, for example. All humans have a "ghost line", a baseline piece of information or energy you can "dive" into (read) or hack (write), which separates them from other pieces of software.
The thing about pantheism is that when you push it out enough it starts to look like atheism. Shirow's manga is suffused with his idiosyncratic musings on the way technology and the world of the spirit intermingle, but his inclusion of the idea of a machine that can generate its own ghost introduces a destabalising element to the cosmic order: where do you find Cartesian dualism if everything has its very own ghost, including our computers? Do we not then jettison the spirit world all together for the sake of simplicity? Shirow is too wedded to his systems and phases to accept this, and he continues to believe in channelers and psychics. The anime, however, is more ambiguous, which is partly why it is one of the rare cases where an adaptation improves on the original.
The actual title of the manga translates as Mobile Armored Riot Police, and the philosophical stuff is definitely a side-order to the main course of running, jumping, shooting and intrigue. The anime chooses the subtitle of the manga as its title, and flips the focus onto the existential crisis of its hero. Its pacing is deliberately slow-fast: kinetic pieces of action are followed by languorous sequences where the Major dreams of her robotic rebirth and then relives that dream by floating on the ocean. The Puppet Master chooses her as his mate because they are alike. "He" is a program used for corporate espionage trying to escape his masters. She is an assassin who's body and soul is owned by the corporation that made it (one that dictates she has to be naked in order for her invisibility to function). In the middle of the film there is an at-first bewilderingly long set-piece where she wanders New Port City, soundtracked by a Japanese choir (borrowing the harrowing vocal tones of Bulgarian folk music). The metropolitan anomie is given a cybernetic gloss as the sequence ends on a shot of shop window mannequins. Kusanagi dreams of a new life beyond the borders of this one, just as the Puppet Master desires a life beyond the networks he traverses.
At the beginning of the film, Kusanagi explains the dangers of specialisation to a new recruit, saying that unpredictability and adaptation are necessary to make the unit stronger. The Puppet Master uses the same arguments at the end to convince Kusanagi into a sexual (in the biological sense) union. Rather than living forever and reproducing endless copies of himself, he desires a dynamic system where death and difference is the norm. The film overlays this fusion with sexual, violent and religious imagery. Sex inevitably entails death, as it is the activity that allows for our replacement. Just before the union is complete, Kusanagi witnesses an angel descending over her, blessing the new bond. The sense is that they have both transitioned into a higher order system, that much closer to the gods. But it is just as easy to read this as the machine not only generating its own ghost, but a sense of the numinous humans have evolved with.
That final showdown between the Major and the tank is not set to a thumping techno soundtrack. Instead, it speeds up the juxtaposition of kinetic and meditative scenes running through the film, and overlays it with mellow flute washes evoking the immemorial past. It is a samurai duel in the 21st century, set against the backdrop of a Phylogenetic tree of life, shot to pieces by modern machinery. The symbolic richness on display is characteristic of the film, in which every element: the voice in the lake, the three different cases (which are three different chapters in the manga) is weaved together in ways only multiple viewings can unravel. That mixture of depth and directness is what makes it a great film.