In many textbooks, the unit factor method for converting units is described in this way:
In dimensional analysis, a ratio which converts one unit of measure into another without changing the quantity is called a conversion factor. For example, kPa and bar are both units of pressure, and 100 kPa = 1 bar. The rules of algebra allow both sides of an equation to be divided by the same expression, so this is equivalent to 100 kPa / 1 bar = 1. Since any quantity can be multiplied by 1 without changing it, the expression "100 kPa / 1 bar" can be used to convert from bars to kPa by multiplying it with the quantity to be converted, including units. For example, 5 bar × 100 kPa / 1 bar = 500 kPa because 5 × 100 / 1 = 500, and bar/bar cancels out, so 5 bar = 500 kPa.
I know how to do it, i know how to calculate it, but i don't know why it works.
Mathematically 100 kPa / 1 bar isn't equal to 1. It doesn't make mathematical sense to consider it as 1.
It just doesn't feel right to me to consider it as 1 and hope it acts as 1 and then cancel things out.
The proof that multiplying by the conversion factor is the same as multiplying by 1 doesn't seems rigorous at all.