Machine Spirit
Any sufficiently advanced technology is indistinguishable from magic.
-Arthur C. Clarke
In the grim darkness of the 41st millenium, everyone thinks machines have souls.
Even worse, they very well might be right. Because that is just how messed up everything is in the big blackness of the grimdark future.
This isn't really that absurd a belief, considering how we tend to personify things like computers and cars - ascribing them personalities, habits and so on. The idea of Machine Spirits is what develops when you let this rampage unchecked by common sense among a technocratic & theocratic ruling class. However, what's important to know is that prior to humanity's downfall and the Dark Age of Technology, artificial intelligence was widespread in what was a typically utopian future. Given that the Adeptus Mechanicus have a hard-on for hoarding ancient technology, it's not unreasonable to assume that particularly old and/or complex machines do in fact think for themselves. This turns into nightmare fuel when you realize that Mars is honeycombed with factories, warehouses and other facilities in varying states of disuse - facilities that were the battlegrounds between the loyal and heretical halves of the Mechanicus during the Horus Heresy. Hideous self-aware weapons of death may still stalk the lower levels, insane from 10,000 years of solitude. For the rest of the Imperium, Machine Spirits are a reason to maintain machines and treat them with respect - from rituals of cleaning to appease a simple Lasgun to the complex rites performed to reawaken the demanding and temperamental machine spirits of Titans.
There is also one other problem that one tends to forget--there actually are things called Machine Spirits. After the rebellion of the Men of Iron during the Age of Strife, Artificial Intelligence was declared "Abominable Intelligence" by decree of the Emperor of Mankind. To get around this, human brains were recycled and placed into the more complex machines (such as Robots, and shipboard AIs) which would then process the more complex information and control systems under the direction of a human. Being recycled from dead humans, they're understandably pretty cantankerous. Plus there are several signs that some advanced equipment, like Land Raiders, Titans and some old spaceships, has actual inorganic A.I. installed due to Golden Age origin and Mechanicus's inability to fully understand how this things work.
It is also implied sometimes (depending on the source) that Machine Spirits may be more real than first thought. There are examples of weapons that have no power source still being able to fire themselves. There was also at least one instance of a bunch of gears that were not connected to anything but each other (i.e. no motor) actually moving on their own after being talked to by a Tech-priest (maybe micro-motors? The Mechanicus is actually advanced). Or a gun that actually felt that it failed its master. Considering the Dark Age of Technology's feats, it is possible that dark age humans had successfully found a way to bend the warp into machines to give the machines their own "soul". This may also have helped cause the Iron War. After all, what does Chaos do with unprotected, unaware souls? Heh, yeah. Anyway, most "leftover" Machine Spirits tend to be a bit crazy, though, and using human brains merged with tech is safer because at least you know how the brain works.
In truth, and after checking most fluff material both from the Imperium's codices and Black Library novels you can find there is plenty of examples of Machine Spirits actively working along with Techpriests, Space Marines, Titan crews, etc, and they will show enough independence of thought to get mad if an enemy hurts their operators or know when to sacrifice themselves if there is no other way to get the task done.
Some authors imply that the existing machine spirits are actually the remaining "Men of Gold", the only true and relatively benevolent machine spirits. These machine spirits are not particularly fond of helping their human caretakers as they have little reason to despite being extremely powerful and having full knowledge of the object they inhabit. Tech-priests rarely interact with these passive aggressive mechanical individuals and have almost no memory of the event, even so these spirits often require a lot of convincing just to make the on/off switch work.