From [this stackexchange](https://tex.stackexchange.com/questions/87134/what-is-the-advantage-of-using-f-prime-instead-of-f) `'` is a shorthand for `^{\prime}`, thus `f'` is equivalent to `f^{\prime}`. Where you need `\prime` is when writing e.g. `f^{(\prime)}` for \(f^{(\prime)}\).