I visited website B after visiting website A. Upon clicking the search bar on website B, a dropdown menu appeared containing the words I searched on website A. After clearing my browser history and cookies, the search bar on website B no longer displayed my previous searches on website A. Does this mean that website B could track my browsing history on website A?
This is a feature of the browser, whichs saves form information such as names, email addresses, and phone numbers, in order to make it easier and faster to input your information across a wide array of websites. So, clearing out your browsing history also deleted this form information.
So, this specific issue is not due to tracking.
However, many social media sites such as Facebook, and other companies like Google, have embedded trackers in an extremely large number of websites. When you visit one of these websites, scripts from these companies are run which track your activity on the site, and use it for any purposes they choose. So, many 3rd party sites do track you whether or not you use their service.
Have you ever looked at a product on a shopping site on the web, then seen ads for that product that seemed to follow you on the web for days or weeks afterwards?
It's not difficult to track users as they move from site to site on the web. There are many ways that this can be done, here are a few: https://twitter.com/clry2/status/1004754363745734656