Ratios are unitless there are no units that are associated with a ratio, but they can be written using units (or without units) which is the confusion you are experiencing.

When they are written using units the units have to be of the same type so they can be cancelled out, so that overall the ratio is unitless. Think of it like a fraction: 10 to 6 as a fraction is 10/6 which simplifies to 5/3 which is the ratio 5 to 3. Instead if I had 4mm to 3mm this is the fraction 4mm/3mm the mm cancel to leave 4/3 or the ratio 4 to 3. If I had 2m to 1mm then the fraction is 2m/1mm the metres unit doesn't cancel with the millimetres unit, but because they are the same type of quantity i.e. distance, we know that there is a way to convert between the two 1m=1000mm, so the fraction becomes (2x1000mm)/1mm the mm now cancels leaving 2000/1 or 2000 to 1.

It is perfectly fine to write ratios without units, such as 3 to 2, in fact mathematically it is usually more convenient to cancel any units out. It is also perfectly fine to define a ratio using units it's just a bit lazy, as it leaves the cancelling part as an exercise for the reader. It is often useful to leave the units as it makes things easier to comprehend/imagine, for example the ratio of the size of an atom to an apple is roughly the same as that of an apple to the earth (here the distances are a bit rough and badly defined, an apple width is not a standard unit of measurement, the earth is not a perfect sphere, etc, but you get the idea of the tiny size of an atom from the units being used in the ratios).

If the units don't cancel it's not really a ratio but a rate, e.g. 4m to 2s as a fraction is 4m/2s = 2m/s which is a speed, a rate (of motion) not really a ratio. See

https://en.wikipedia.org/wiki/Ratio#UnitsHope this helped,

R. Baber