From the definition of derivative, combined with the equation of a straight line, we know that the tangent to $f(x)$ in $a$ is
$$ g(x) = f(a) + f'(a)(x-a) $$
I was writing this equation in a function grapher, but I made a mistake and wrote $f(a) + f'(x)(x-a)$ instead ($x$ instead of $a$ in the derivative). However I noticed that this function approximates $f(x)$ very well (better than the tangent). What is it? Why it works so well?
Let $g(x)=f(a)+f'(x)(x-a)$. Then $$f(x)-g(x)= f(x)-f(a)-f'(x)(x-a)= (x-a) \left(\frac{f(x)-f(a)}{x-a}-f'(x) \right)$$
If $L(x)$ is the tangent approximation, then $$f(x)-L(x)= (x-a) \left(\frac{f(x)-f(a)}{x-a}-f'(a) \right)$$
Note that as long as $f'(x)$ is continuous at $x=a$, everything works nicely, but as uniquesolution pointed, this might not work nicely when $f'$ is not continuous at $x=a$. In that case, your approximation is clearly worse than the tangent approximation.
Note If you want to compare the two approximations, to decide which is better, the question simply becomes "Does $\frac{f(x)-f(a)}{x-a}$ approximate better $f'(x)$ or $f'(a)$?"
Geometrically the question you ask is "If $x$ is close to $a$, is the slope of the secant $(x,f(x)) - (a,f(a))$ closer to the tangent to the graph at $(x,f(x))$ or the tangent at $(a,f(a))$?"
I don't think that one should expect the answer to be independent of the choice of the function.