Each unit has offensive and defensive values. Roughly speaking the odds are 50/50 with an offense value of 1 versus a defense of 1. That is to win a single round of combat.
Combat consists of many rounds, units battling it out until one is eliminated. Offensive and defense are also modified by several factors such as veteran status, terrain, city improvements, fortified, and what not.
Here's how hit points and fire power come in. Each unit can take 10 times the hit point factor in damage before it is eliminated. Pre gunpowder units have HP factors of 1, post gunpowder units have HP factors of 2 or 3. The firepower rating tells you how many damage points are inflicted when a round is one. Most FP's are 1, but some such as artillery have a FP of 2, meaning they need only half as many hits to eliminate a unit.
This is somewhat simplified. There are many nuances to the basic scheme. An example is that ships bombing land units have their firepower reduced to 1 regardless of their normal rating. And there are many other such examples.