The numbers printed on an item are not the numbers the game uses. Below is what the code actually reads, table by table.
A weapon does not raise your attack. When a blow lands, the game takes the attacker’s weapon row and adds a bonus that depends on what is being hit. A sword is worth more against people, an axe is worth more against dinosaurs.
Poison, fire and plain arrows (5, 6, 7) are two-handed: taking one drops your shield. The four legendary weapons are simply much larger numbers in the same table.
Defence is not stored with the shield. It is read out of the attacker’s weapon row, at offset 0x28 plus the shield’s item id, so the same shield stops a different amount depending on what is swinging at you.
The two legendary shields sit past the end of the small defence block, at offsets 0x3d and 0x40, where every weapon row happens to hold the same constant. That is why they look disconnected if you read the item table, and why they are in fact worth a flat 15 and 20 against everything.
These are the only items whose printed stats are real: using one runs the bonus routine and adds the numbers to the unit, then the item is consumed.
A wounded unit will drink a potion on its own once its health drops below half.
These are picked up into inventory slots 9 to 11. Combat only ever reads the weapon slots (0 to 2) and the shield slots (3 to 5); the bonus routine only ever runs for the food slots (6 to 8); and clicking an artifact in the panel just unequips your weapon. Their defence, magic and speed never reach the unit.
The stats are there in the data, they are simply never read. Most likely leftovers from an earlier version that nobody wired up before release.