There's a notion called a "differential form". If $x$ and $y$ are functionally dependent and differentiable, then it turns out that the differential forms $dx$ and $dy$ are (more or less) multiples of each other, and the ratio happens to be $$ dx = \frac{dx}{dy} dy$$ This fact isn't _really_ just cancelling the numerator and denominator.
Before I learned differential forms, I imagined a term "$dz$" as being a derivative with respect to some variable I hadn't decided yet. So I had interpreted the equation above as really meaning
$$ \frac{dx}{du} = \frac{dx}{dy} \frac{dy}{du} $$
where I hadn't really decided what variable I wanted to use for $u$.