Is it correct that they use a matrix transformation?
It depends on the kind of function and what exactly you are trying to do. For example, you might have a function in closed form and you want to compute its derivative. Then using symbolic math software, e.g. MATLAB or Mathematica, you can determine its derivative in closed form. The software does nothing more than applying the differentiation rules, which might be tedious to do by hand.
On the other hand you might have e.g. a collection of pairs $(x_i,y_i)$ of numerical values corresponding to evaluations of some function $y=f(x)$ at points $x_i$, i.e. $y_i=f(x_i)$. Then there are various algorithmic procedures to create a new sequence, which approximates evaluations of the derivative of $f$. This is a subject of numerical analysis. As you mention, one way is to use the so called "difference matrix". If you look at the documentation of the function you are using, there should be reference to which method of differentiation is employed (MATLAB has very good documentation).