At a MECHANICAL disc brake - an inner cable (red arrow) that runs in an outer housing (blue arrow) gets pulled by the brake lever and activates the brake. Brake performance can be influenced by cables which are frayed, stretched, dirty or kinked.
At a HYDRAULIC disc brake - the pistons (the part of the brake that pushes the brake pad onto the rotor) is activated by hydraulic fluid being pushed into the system at the lever end, which then pushes the piston out. The fluid in the system can't be compressed, therefore whatever force gets applied at the lever (red arrow) pushes the pistons out (blue arrow).
Note: You will also see the various parts of the disc brake setup in the image below.