Some websites embed Facebook plugins, e.g., comment with Facebook, Facebook messenger live chat, etc.
The first time I visit one of those sites, they already know my currently logged in Facebook account.
How is that possible technically?
Because Facebook knows your browser. When you logged in, it almost certainly set cookies, but it can identify your browser in other ways, like your IP address, installed add-ins, et cetera and so on.
Since the plugins are also served from Facebook's domain(s), it can "see" your browser when you visit other sites, so it knows it's you.