"These are not the droids you're looking for." The line is iconic. The power behind it is pretty iconic too, but what is the Jedi mind trick? How does it work and why doesn't it always?
The Force flows through and from all living things, connecting them together. According to Obi-Wan in ANH, the Force can have a strong influence on the weak-minded. Force sensitives can use the Force to sense the emotions those physically and emotionally close to them. Some of them can even use it to exchange words with other Force sensitives. They can also use it to tame, make friends with, or otherwise control different animals. Clearly, the Jedi mind trick is closely related to these other abilities. In fact, it's basically the ability as animal taming applied to sentients. From the way victims parrot the exact words of the person mind tricking them, it seems like a mind trick involves implanting a thought directly into someone's mind.
Obi-Wan makes it look easy, but it's a hard trick to pull off. We see a number of younger or otherwise untrained Force users (Ahsoka, Ezra, Rey) struggling with the mind trick. Even fully trained Force users can have trouble with certain individuals. The prison guards in TCW episode "The Academy" are able to resist. Poggle the Lesser is resistant to Anakin's mind trick interrogation in "Brain Invaders" until he get's Force choked. Cade Bane resists too, even under pressure from multiple Jedi, in "Children of the Force." When Kanan attempts to mind trick Governor Pryce in Rebels "Through Imperial Eyes," she punches him in the face. There are at least two species who physically can't be mind tricked at all: hutts and toydarians.
What do all of these resisters have in common? From a Doylist perspective, none of them can be mind tricked because otherwise the plot would be over too quick, but what's the in-universe reason? In Rebels, Kanan mentions that he can't mind trick Ezra. As someone already sensitive to the Force, you'd think he'd be easier to mind trick if not for one key thing. Ezra has training to sense the Force and be aware of his own thoughts and emotions. In all the specific examples mentioned above, the targets are aware that a Force user is going to try to mess with their heads. They are on the look out for incongruous thoughts and are thus able to resist. Presumably, there's something about the minds of hutts and toydarians which make them uniquely good at spotting intrusive thoughts.
So what makes someone susceptible to the mind trick? Weak-mindedness? Mind tricks fail when the victim is expecting it. It fails when they are aware of the boundaries of their own minds. In one instance in Rebels, it fails because a guard knows he shouldn't be taking orders from someone dressed as a cadet. Context seems to matter. A person is more likely to give in to the mind trick if it's something reasonable based on their situation. Obi-Wan in ANH is able to convince a pair of bored guards to not care about the boring job they probably already don't care about. In "The Gungan General," he's able to convince a pirate he'd rather go get drunk than watch prisoners. Convincing someone who is attempting to resist requires more effort. Obi-Wan, Mace, and Anakin are visibly strained as they attempt to force Cad Bane to reveal the location of the kidnapped children in "Children of the Force." Bane, meanwhile, acts like what they're doing is causing him intense, physical pain. Kana and Rey react the same way when being compelled to talk with the Force.
How do you think it works? Am I right or am I crazy? Would you be able to resist a mind trick? Based on the way we see the Jedi use it, do you think it's ethical?