Algebraic manipulation is always a fun way to make something profound seem like mere trickery.
We’ll derive importance sampling by showing how it reduces to multiplying and dividing by the same thing (and is therefore equivalent because we just multiplied by 1).
We have some random variable
We now introduce another PDF
Remembering the trick makes it easy to re-derive thankfully. I never remember it and had to do this derivation twice in the 10 minutes it took to write.