These are some philosophical, speculative ramblings about how the human spirit works and how the Holy Spirit interacts with it.
Knowing ones ability to do evil (like murdering someone) is not doing evil. And suffering the temptation to do evil (like murdering someone as the seemingly easiest solution) is not doing evil either. One could argue that knowing ones ability to do evil, combined with logical thinking, is a specific kind of temptation; because sometimes, an evil act seems desirable to the logical mind.
The problem is, resisting temptation needs a mental effort of “good will”, and the human abilitiy to be successful here is simply limited. Temptation consumes “positive moral energy”, and if all is used up, man starts to do evil acts. That’s why people are seen to be “good” under normal conditions, but start to be evil when under stress. See also Mk 7:20-21.
So what man needs is a constant, super-human source of positive moral energy. Jesus can be said to have possessed this source: he was tempted for 40 days under extreme physical stress, and did not give in; that’s clearly super-human.
I assume that the Holy Spirit is this external, super-human source of positive moral energy. When “having” the Holy Spirit, it should probably happen that a “good thought” pops up in ones mind without one having produced it with from ones own good will. That is, such a though would pop up without consuming good will (“positive moral energy”).
Further, we should assume that such a thought has the same physical appearance in the bran as a though created by ones own good will; because it “feels” no different. This does however not mean that a miracle is implied here that contradicts the natural laws. It’s supernatural, but the law of conservation of energy is probably intact. Because, brain activity is a statistical process, including much random activity. So to create a thought in our mind, the Holy Spirit coordinates the quantum probabilities of neurons so that this thought emerges, where otherwise would have been just noise.