To keep you logged in a website will generate a secret code and send it to your browser to be stored as a cookie.
"Cookies" are small amounts of data that are associated with particular websites and the browser will only get data for the website on a request from that particular website. This is so that no website can ask for all the cookies. Cookies are used to keep track of interactions in a way that the hosting site doesn't have to record them all. Things like what was the last item you looked at or bought or, in this case, the secret code that says you already passed the log in test.
What you describe is typically what happens when all the "cookies" the browser has stored are deleted.
Sometimes these are grouped into "website data" and so a request to cleanup website data will delete the cookies.
If the browser was removed from the computer, the cookies will also be deleted, even if another copy or newer version is then installed. Normally upgrades to browsers don't delete the cookies.