Excepting Psi combat, artillery duels, probe combat, & some air combat, the base value for the attacker is the weapons rating, and the base value for the defender is the armor rating.
Modifying this base value (multiplicatively) are terrain factors, base factors (+25%, more with perim defense/tachyon field), and morale.
Terrain mods are listed in the book, but the basic ones are +50% forest or rocky, +50% for mobile in the open.
Base factors are +25% for nothing, replaced with +100% with the Perimiter Defense against land attacks, same for Aerospace Complex vs air and Naval Yard vs naval. +100% on top for Tachyon Field. Sensors add +25% to bases within 2 squares.
Morale is +12.5% per level above or below Disciplined. I think the morale order is: Very Green, Green, Disciplined, ?????, Veteran, Commando, Elite. (can't remember the one above Disc.)
A few special abilities offer further bonuses to the unit.
Reactors multiply the base 10 hits a unit can take by the reactor level.
So, an example:
Shard(13) Elite X Needlejet attacks Silksteel Disciplined AAA Fusion Garrison in a base with Aerospace & Tachyon, & nearby sensor array.
Attacker: 13*1.5
Elite*1.5
Nerve Gas = 29.25
Defender: 4*3
Aero&Tach*2
AAA*1.25
Sensor = 30 (also has 20 hits from fusion reactor).
It is a close battle, except the plane has 10 hits and the garrison has 20. You could resonably expect the attacker to damage the defender to about half way (estimate, don't quote me on it).
So how do you determine who wins each hit? Well, a close approximation is to take the two values and add them together, and divide each by the total amount to determine a % chance to win:
29.25+30 = 59.25
Attacker: 29.25/59.25 = 49.4%
Defender: 30/59.25 = 50.6%
Whomever gets reduced to 0 first loses. In this case, the plane will take one hit for each the garrison does, and when it hits 0 the garrison will still have 10.
Other combat Types:
Artillery duels: Use weapon against weapon value.
Air-to-Air (interceptor scrambles): Use weapon v weapon.
Probe: Only the morale bonus % counts, and base attack/defense is 1 each. High reactors still modify hits.
Psi: If a Native unit, or one with Psi armor or Psi weapon, is involved in combat, all armor/weapon values for BOTH units are ignored, and replaced with the psi base values (below). Only use morale bonus % to base attack/defense, with the exception of the attacker gets to add (subtract) 10% per point of bonus (penalty) in their PLANET Social Engineering value.
Base values for Psi combat are:
Any land unit involved: Attacker 3, defender 2
All sea/air units: Attacker 1, Defender 1.
In addition, the psi unit does a number of hits with each attack = 1*enemy reactor level. In other words, it is as if the psi units enemy only has 10 hits, not 10*reactor level.
That's a pretty rough summary. The manual has most of the mods, and I may have skimmed a few points here and there. I'm sure if I made a major error in how it works, someone here will point it out.