Cosmic JS is a headless content management service or CMS, which handles storage / creation / modification of resources. So for a blog you might have 2 resources: Authors and Blog Posts. As an admin of a blog you would log into Cosmic JS and create an Author with some details, and then create a Blog Post with whatever content you want in your post. Gatsby is a static site generator, building HTML / CSS / JS files based on whatever node / react logic you provide it. So Cosmic JS is just a solution for managing the resources that Gatsby uses to build your static web site files. Every time a blog post is created, Gatsby fetches all data required for the pages it needs to display, then builds those static files are served to the end user.