It is done by allowing fluid to flow through passages between chambers separated with a piston. Your car’s shocks and struts work the same way. There are also ones with external reservoir that may allow for more travel or that can be pressurized to alter resistance.