It's a (seemingly) pretty simple matter of keeping track of how long someone looks at a video, and optimizing to show them videos they'll spend a long time looking at. It's pretty powerful too, I spend much more time looking at TikTok than any other digital content aggregator (to the extent I had to delete it from my phone). They also do some things like sprinkle in random fresh videos, potentially unrelated to your…
Similar experience here. One night a few months ago my girlfriend and I decided to download it as a joke. We laughed at some videos for a while and went to sleep. A couple months later she'd spend hours upon hours every day looking at it, even foregoing some of her hobbies. Eventually she realized it was too much and also uninstalled it.