Side topic: how to create a virtual video device?

I want to process camera input, e.g. cartoonizing human, embed virtual objects, overlaying myself over presentation, etc during virtual meeting.

There are project like pyvirtualcam [1] that allows you create video frame, then write it to obs. But how does obs do it in the first place? What are the steps to do it from scratch? Can someone point me to some keywords/reference?

[1] https://github.com/letmaik/pyvirtualcam