Ghosts are the sort of units made for this type of attack. Art by Shiramune
Thus, what is of supreme importance in war is to attack the enemy's strategy.
The very genre of StarCraft 2 lends it and the study of its nuances to tactical reasoning. It's called a real-time strategy game for a reason. If no actual strategy was involved, it'd be a real-time blowing-crap-up simulator. And while lots of stuff blows up but good in your average StarCraft 2 match, most of those explosions are due to at least one of the players involved implementing some form of strategy.
Therefore, when you're preparing to attack the enemy, your actual aim becomes to undermine their strategy with yours. There are multiple ways to do this, and I'm going to discuss three in particular, all of which could be subjects in and of themselves in terms of proper execution. And when I figure out exactly how to pull these off well, I'll be sure to let you know.
Ambushes
Being caught out of position has been the downfall of many a military operation. With a little intelligence and preparation, you can predict the route the enemy is going to take and prepare a force to deal with them in transit. You may try to flank them from one or both sides, wait until they pass to rake their formation or harass them at multiple points. But the biggest damage you're doing is actually psychological.
Provided you were careful with the disposition and placement of your forces, your opponent will not have seen the ambush coming. They thought they had a clean route right to your front door. They might have already been thinking ahead to the order in which they were going to burn your base's buildings down. And then lo and behold, their forces are under attack. It's a plan that can deprive a key push of momentum, buy you time to build up your own forces or simply a way to keep your opponent off-balance.
Feints
Similar to ambushes, a feint sets up your opponent's expectations and then knocks them down with authority. An example would be using close-range or melee units to harass the defenses or resources of the enemy, pulling them back when their counterattack begins and bringing the enemy into range of the more powerful artillery you had lurking just out of range, hidden by the fog of war. If your force survives you can continue pushing into the enemy position, and even if it doesn't your opponent must now rethink their units and deployment to compensate for this new information.
Beyond the mere exchange of fire, however, a canny player can work a feint from a different perspective. For example, a Terran player is likely to begin building Marines. If the Terrans' opponents are the Protoss, and a few waves of Marines or Marauders break on the Protoss defenses but do a little more damage with each push, the Protoss player may opt to build Colossi to compensate. However, the Terran player has actually developed his air power and when the 'death ball' approaches, the Protoss player faces a squadron of cloaked Banshees that use the Marines & Marauders as backup units.
This is just one example, and I'm certain you can think of others.
Economic Damage
Ultimately, all of the strategy, tactics and unit composition of any plan hinges on one thing: having enough resources to pull it off. From the start of the match any player worth their salt is sending workers to collect minerals, harvest gas and expand the means of production. They are diligent, tireless and essential to building bigger, more impressive units.
They're also quite vulnerable to attack.
A potent strike on the mineral line of an opponent can slow or cripple their efforts. In some cases your opponent will quit entirely (especially if they believe they've been cheesed). Early harassment, stealthed units or a focused push can absolutely gut their economy. Not only do you deprive them of the resources those gatherers were collecting, they must also expend time and resources to build more. You can use this opportunity to surge ahead in general army count or push higher into your tech tree.
How else would you attack the enemy's strategy?