From the docs, the definitions are:
..a variant of linear scales with a discrete rather than continuous range. The input domain is sti
In general terms, the difference is similar to the difference between the mean and median.
The difference is only really apparent when the number of values in the input domain is larger than the number of values in the output domain. Best illustrated by an example.
For the quantize
scale, the input range is divided into uniform segments depending on the output range. That is, the number of values in the domain doesn't really matter. Hence it returns 1 for 0.2, as 0.2 is closer to 1 than 100.
The quantile
scale is based on the quantiles of the input domain and as such affected by the number of values in there. The number of values in the output domain only determines how many quantiles are computed. By their very nature, the quantiles reflect the actual list of values rather than just the range. Thus, an input of 0.2 returns 100 as the corresponding quantile is closer to 100.