How does the JSON API work to parse incoming JSON and fetch a post based on an ID?

How does the JSON API work to parse incoming JSON and fetch a post based on an ID?