Equipment can be enchanted to increase its "magic level" (the blue stars) and stats.
Enchantment costs other equipment or enchantment material. Normal equipments or shards give +2 to +6 magic points, and equipment crafted from equipments or shards give the value of all constituent materials. Below is a table of how many magic points are required for each magic level.
✝ ignore defense is both physical and magic, so this number actually becomes 30, and then the bonus is divided among the two types
The effect from enchanting equipment can be determined in this way:
Step 1: Take each stat value of the equipment and multiply it by that stat's attribute value. Sum these to get the equipment's total stat value.
Step 2: For each stat, the bonus from enchanting is effect value * stat value / total stat value rounded down.
A result of this is that the enchantment effect is the same among all equipment of a certain rarity (color) but is distributed among the stats differently depending on their values. Higher stats on the item do not increase enchantment effects.
This may look complicated so here is an example using Hat of the Ocean 5*:
1160 Phy Def, 10 AP Bonus, 8000 effect value
using the Attribute Value table above:
total stat value = (1160 * 15) + (10 * 100) = 18400
then Phy Def is 8000 * 1160 / 18400 = 504
and AP Bonus is 8000 * 10 / 18400 = 4