A recorder can record all the time or only when something happens in the frame. Recording on motion saves disk space and makes searching the archive easier.
Basic detection reacts to any change — leaves, shadows, rain. Modern cameras can also recognise people and vehicles, which greatly cuts down on false alerts.
Example
At night, when a person appears in the warehouse yard, the owner gets an alert on their phone.