How does AI in e-commerce personalize my shopping recommendations?

I keep seeing personalized recommendations when I shop online but how does this AI actually work? like sometimes it suggests things genuinely buy but other times it's way off why does it think I need another blender after I just bought one? Does it track my clicks how long I look at items or even what I add to cart but don't buy? And what about when I'm shopping for gifts versus stuff for myself does the AI get confused? Can I actually train it to be more accurate by ignoring certain suggestions? is this just smart marketing or is it really learning my preferences nd should I be concerned about privacy with all this tracking? Honestly I'm curious how much is clever algorithms versus just guessing does anyone else find these recommendations helpful or do you mostly ignore them?