How does docker inspect work?

When I run docker inspect,how does it work? Which files does it reads?