On the Ghost in The Shell universe, a Ghost [ゴースト] is the conciousness of the individual, and the only thing that differentiates a human from an android, regardless of how much mechanical material you have on your body, as long as you have a ghost, you still maintain humanity and individuality.
Said concept was clearly borrowed from “The Ghost In The Machine”, by Arthur Kloester, being said term coined by Gillbert Ryle to describe the dualism of mind-body relation, Shirow, Ryle and Kloester, all of them share the thought that a person’s mind is not a independent entity, just habiting temporarily the body of a person, here, Kloester argues that the human brain has evolved, how it has retained and built over more primitive brain structures, and these primitive layers sometimes overcome the logic, creating emotions like anger, hate, fear, etc.
On the case of Shirow, he describes the “Ghost” like something broader, taking on account the whole body, like, for example, if a organ was removed, then the “Ghost” of the organ is vanished until it is replaced by a mechanical substitute and the existence of that organ is reproduced, being the brain only a part of that neural network, a part of the “Ghost”.
The “Ghost” also borrows elements from the Theseus Paradox, one experiment that raises the thought whether if all the components of a object are replaced, that object is still the same object, that is represented on Kusanagi, that reproduces the neural stimulus of all her organs to maintain her ghost even if she transfers on another body, and the Ghost-dubbing, where the body copy with the same ghost is inferior than the original, being the most successful case on the series the Marcelo Garti one, where they can reproduce his ghost on different bodies unlimited times, being almost identical, but not being the same at the end of the day, proving with that, the Theseus Paradox.
It also borrows from Hegel’s concept of the Geist, being the Geist the spirit/mind of a individual, that is divided into Subjective [Inner Self], Objective [Interpersonal] and Absolute [Someone that knows itself and its goals], being on Shirow’s work, these three phases of the Geist combinated a “Ghost”.
These three elements are the major philosophical concepts behind the concept of the “Ghost” and pretty much explains the complete scence of the concept, that without being too convoluted, is basically representing the humanity of a individual, using these concepts as a base.