So the way schema was originally implemented (as I understand it at least) was with a microdata style approach to adding meta data to content on your site. Makes sense, you have the html you want your users to see, and then you update it with meta data so that search engines can understand more information about what you're sharing with your users. 5~6 years ago, Google, Yahoo and Bing got together to make schema.org to try and wrangle a standard specification that everyone can use on their site. There ended up being 3 specifications you can use, microdata (markup elements directly in your html as needed) RDFa (you can think of this as microdata 2.0 in a lot of ways... it's much more flexible, but still implemented right in the html, along with the content you're marking up) and then there's JSON-LD.
All 3 are basically languages that express similar concepts, they just do it with different syntax and different organizational structures. For example:
Here’s a simple Microdata snippet:
HTML:
<p itemscope itemtype="http://schema.org/Person">
<span itemprop="name">John Doe</span> is his name.
</p>
Here’s the same snippet using RDFa (Lite):
HTML:
<p typeof="schema:Person">
<span property="schema:name">John Doe</span> is his name.
</p>
And here's the same thing expressed with JSON-LD:
HTML:
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Person",
"name": "John Doe"
}
Here's the catch, you my have noticed that the JSON-LD snippet doesn't actually contain the part of the document that mentions John Doe. All it's doing is saying there's a guy named John Doe. It's assumed that the document mentions John Doe somewhere, but it's up to the webmaster to make sure the content on the page actually matches the JSON-LD snippet. That's why Google says not to put anything in your JSON-LD code that's not actually contained in the page. As a relevant example, don't include schema for a location on a page that's not actually about that location.
So, if there's 3 different specifications you can use, which should you pick? It doesn't actually matter hugely, though Google recommends JSON-LD, and JSON-LD is way easier to maintain. Since it's all in one block, you don't need to laboriously sift through a bunch of html just to find the relevant pieces to update or add. In other words... use JSON, and stop using microdata entirely.