Autopilot for the DHC-4 Caribou

I don’t understand how simply turning the AP on causes it to stick to the current heading or hold the current altitude?