vTaskDelay: how it works

very roughly:

vTasDelay suspends the task, ie puts the task on a system list of tasks that will not be scheduled. The number of ticks to wait for is recorded in the TCB (task control block). The sys tick handler decrements the count of each task on the suspended list and puts the task back on the ready list once the count reaches zero, so the scheduler can grant the task CPU time according to the scheduling rules.

The code is in tasks.c.