Hull hardness is a stat that is unique to each ship, and reflects how much damage a ship will take from weapons.
If the piercing value of a weapon is greater than or equal to the target ship's hull hardness, the ship will take full damage from the weapon. For example, a ship with 20 hardness getting shot by a weapon with 30 piercing that does 10 damage per second will take the full 10 damage every second.
If the piercing value of a weapon is less than the target ship's hull hardness, the ship will take reduced damage proportional to [piercing] / [hardness]. For example, the same ship with 20 hardness getting shot by a weapon with 10 piercing that does 10 damage per second will take the 5 damage every second (10 damage * 10 / 20 = 5 damage).
As for why different ships have different hardness values, it's a balancing mechanic that is meant to allow larger and more combat-focused ships to absorb more damage.