from what I know, the calculator uses an approach close to calculating an approximate riemann sum with like 500 rectangles, but the calculator actually uses parabolas, which allow it to trace out curves better for approximation

in terms of simply shading the graph, all it is really doing is connecting points between the function and the x axis, so once it has the function point (x,f(x)) is just draws a line to the point (x,0)