I've just started learning structured data and I'm still trying to wrap my head around the concept.
First I started out with Microdata using schema.org vocabulary and now I'm learning JSON-LD.
The thing that is bugging me is that 'how do search engines know that the structured data that I'm providing in the head matches with the content of the page?' because in the specific case of JSON-LD I'm not specifying which element contains what information.
This was not the case in Microdata where I provide the structured data in the element itself. And to add to my confusion I've read in multiple articles that Microdata & JSON-LD have the same result, which means my understanding of Microdata is wrong too!
Please help me with this. Thank you