The cam rotates at half crank speed and the cam itself has multiple teeth to excite the magnet of the cam sensor which the ECU sees as "event" e.g. crank TDC+plus cam top = engine cylinder position 1 compression - similarly crank TDC + cam bottom = cylinder 3 (etc etc), the ignition and fuelling events are also timed accordingly.
When the VVT works the cam signal will show up before the crank gets to TDC (this is the feedback and confirmation for ecu that the VVT worked in advance mode), ECU will keep on commanding the oil control valve in either advance or retard position which in turn sends oil to the advance or retard channels of the actuator on the cam.