Retention policy characteristics

Hello,
I am pretty new to Prometheus, but got some questions about retention policies.

If I am implementing a retention policy for example to delete old data if it is older then 5 days. How is this handled by Prometheus? If the task kicks in to run the retention policy, so deleting old data. Does this impact the performance? Could hardware usage on CPU, or RAM ramp up? I would guess that the retention policy is handled as a background task. So given a low priority and also not really intensive for hardware usage but I am not sure.
How is it handled if at the same time new data comes in and old data is deleted? I would guess this is buffered in some kind of way.

Thanks a lot already!