the algo is so good and refined and processes such a large dataset amongst you and millions of other users who have similar interests and tendencies than you that it predicts where your interests go
I don't think your thoughts are being analyzed directly like you are suggesting in your first post, but they are being "analyzed" via your participation with millions (actually billions) of other YouTube/google users. maybe you searching about ray peat topics (just an example) on google or YT also matched 1/1000000th of a subset of users and then the algo ran it 19012389123819203891203 more times to identify you as likely desiring to see pokemon videos or whatever because of the association
we are talking literal gigantic data centres with computing power that is very high analyzing things a trillion times a second
and just because it is "computing" on microchips doesn't mean that it is totally apart from the same type of coincidence or luck that happens in day to day life. like you think about a blue Lamborghini and two days later a blue Lamborghini drives past you when you hadn't even seen a Lamborghini in real life before. you wouldn't get worried about that and think your brain waves are being stolen. it's the same thing I think except cruder and not as fun, because it is done by Google inc and not by Universe inc. Universe inc is a better algorithm anyways.
if you really want to test it, sign out of all your google/yt accounts and browse in private mode on browser, then use YouTube. you won't get shown anything interesting.