Sometimes deception is simple. Painting a tank to look like a truck, or vice versa, requires only knowing how the human eye and mind recognize patterns in imperfect images. Although the neurology of pattern recognition is subtle and complex, we can build on plenty of everyday experience. Camouflage  is largely an exercise in deception.
Deception can involve a deep understanding of the adversary's state of mind. Perhaps the oldest recorded example of deception in warfare was the Trojan Horse. This ruse was successful because the Greeks prepared the ground for it with a false ``defector'' and an apparent withdrawal of their forces. Most importantly, the Greeks knew enough of the Trojan character and war-weariness (the war had lasted and Troy had been besieged ten years and the Trojan losses included the recent death of their prince Hector) to be confident that the Trojans would accept the Horse as the peace-offering of a defeated and departing foe. The Greeks had sufficient understanding of the Trojan ``decision loop'' to make the shrewd guess that the Trojans would ignore any cautionary counsel (that in fact was offered by the priest Laocoön and the princess Cassandra) and even the evidence of their own senses (sounds from within the Horse) because they were so eager to believe that peace had come. At a strategic level this deception is most often employed by dictatorships against democracies, for example, by the Germans against the British and French in 1933-39 and by the Japanese against the United States in 1931-41 .
The classic modern example of tactical deception by getting inside the adversary's ``decision loop'' was the successful British deception (Operation Mincemeat) of the Germans regarding the invasion of Sicily. The story is well known , but it is important to realize that the British did not do the obvious by providing the planted corpse with fake invasion plans. They realized that it would not be credible that a mid-ranking officer would carry with him, and be in a position to lose, such critical documents; their discovery would discredit them. Instead, they created putative frank private letters between the highest commanders, of the sort that would plausibly be sent by a private emissary. One letter chattily discussed the use of Sicily (the genuine and obvious objective) as a cover story, while mentioning cover objectives elsewhere as if they were the real ones. A second letter steered the Germans toward Sardinia by referring to sardines, as if tip-toeing around security. The recipient might be expected to take the hint, and the Germans to recognize this and come to the same conclusion. They did so, and sent forces to the cover objectives while leaving the real objective undefended. As Montagu  explains, he success of the deception depended on understanding how the adversary would read the false intelligence. While the Greeks could assume simple wishful thinking on the part of the Trojans, the British had a more difficult task. Lying is easy, making the lie believed is harder, and hardest of all is to make someone believe one is lying when one is actually telling the truth.
There is a long history of tactical deception to cover surprise attacks. Modern examples include the German attacks on France in May, 1940 and on the USSR in June 1941, Pearl Harbor, the Normandy landings, the Yom Kippur War and the terrorist attacks of September 11, 2001. In fact, it is difficult to find a case in which the defender clearly and correctly anticipated a surprise attack. Generally the deception was straightforward rather than subtle, a combination of ordinary operational security (radio silence, encryption, and controlling the distribution of plans) and diversionary operations.