How does Google Search know which paper you have cited?
It seems to me that if this was an automated process, then Google would have to keep track of every single new paper which has been published


Yes, this is exactly how Google does it. They crawl the web anyway, and if they find something that looks like an academic paper, they add it to their special Google Scholar index. Extracting citations from PDFs is technically not easy, but not something that is a big barrier if you have the manpower and years of experience in information retrieval like Google does.

As for how they get access to IEEE etc. - this is to the best of my knowledge not disclosed. Maybe they are just paying for institutional access like everybody else, maybe they get free access from the content providers so that they can build up their index.