Suppose Jack praises John. The apparent reason is that he has appreciation for John’s deeds. But the real motive could be just to flatter him, to get some favor extracted from him.
Any action will have a usual motive (like the first one above) and a real motive (like the second one above) which may or may not be same.
Why does this work? Its working rests upon the following property of a cause-effect pair :
If a cause happens the effect will happen, but the fact that an effect has happened (and this is known first) doesn’t necessarily imply that the same very cause has indeed taken place. The effect might have happened owing to some other different cause. It is an illusion to think that the usual cause has happened when the effect has taken place , just because the usual cause almost always creates that effect!