The same way a web browser knows how or interpret html. The client is written against the spec. The API drives the behavior, just like html does.
This is great in theory, but very hard to do in practice.
This is great in theory, but very hard to do in practice.