Both, depending on the model.
Typically, a triggered motion sensor initiates a video recording. Ringing the doorbell will initiate a live view between the camera and your phone.
Most models will record or take pictures of who is at the door to check later if you do not answer.