Explain the function of a slave cylinder and a master cylinder in a hydraulic system, such as an automotive clutch or brake system.