If you can’t surpass your opponent’s strength, you’ll suffer a defeat.
 
You will also lose units, but as long as you meet 2% of the defender's strength or have 1 million or more attack strength in a certain category, you will be able to do some damage to your opponent's units. Of course you won’t gain any resources or take over the attacked habitat, but you are going to receive some XP for every unit that has been killed by your army, nonetheless.