Course of the fight:
In each round each unit of both sides fire once. A shot hits a single, coincidental target of the enemy (exception: rapid fire), the damage done to one unit gets first substracted from the shield, if those are down, the hull gets damaged, if a ship has no hull anymore, it's destroyed. Between the rounds of fighting the destroyed ships of the previous rounds get substracted.
Formulas:
Attack and shield strenght are defined for each unit and are to be read up in the descriptions ingame; the hull points are 10% of the structural integrity, structural integrity points are the same as the amount of metal and crystal built into that unit, therefore: hullpoints = (metal+crystal)/10. Weapon, shield and armor can be raised through researches, 10% each level. As the target hits are coincidental, the chance a unit gets hit is for each 1/(number of all own units).
After a fight a part of the defences get build up again, 60 - 80%, seperately for def types (rocket launcher, light laser etc) . When there are under 10 units on a planet, the possibility to get build up again is calculated for each unit individually, so it is theoretically possible that from 9 rocket launchers none gets rebuilt.
There are two particularities:
1) Chance to explode: as soon as the hull integrity is under 70%, there is a chance that a ship might explode when it absorbs the shot with shield or hull. This chance is the the percential stake in the total damage. A hit that hightens the damage up to 40% creates therefore a chance of 40% the ship explodes. Remember: a hit at a ship with full shields and 40% suffered damage which did not go through the shields still makes a 40% chance the ship explodes. Exception: ineffectualness rule
2) ineffectualness rule: If the attack value of a unit is only 1% or less of the shield strenght, so it will not cause any damage against the hostile unit. Therefore deaths stars (and also shield domes) cannot be destroyed by some ships and defence units as long as the shields are up.
As there is a lot of coincidence towards this as you see, you shgould always use a fight simulator:
Useful Ogame Tools.