In most cases, the 12-V cigarette lighter is the power source. Some dash cameras have a built-in battery.
This functions as a backup power source so that when the vehicle is turned off, and there’s an event that’s worth recording, like another vehicle driving very close to the truck, the camera uses power from the built-in battery to record.