What is a headless CMS
A classical CMS provides a way to author content and a way to render that content as web-pages. A headless CMS provides content authoring but instead of web-page-rendering, it provides the content as data over an API. You then write one or more front-ends that present the content to end-users. The front-ends can be web-sites, apps, voice assistant skills, e-book generators, games etc. The grand idea is that when content is pure data, presentation modes can evolve independently of the content authoring.
A fair question then would be: what's the big deal? Can't you just stick an API on Wordpress and off you go? That leads to the other, less obvious difference: A good headless CMS is focused on authoring the content as structured data so that it is clear to the presentation layer what each piece of information means. Take this fact-box from a project page on the (Sanity powered) OMA.eu site:
The map, timeline and bar chart here is rendered on the front-end based on geo-positions, lists of milestones and area-usage authored by the OMA editors. In their old CMS these would be authored as images and html-fragments, but with Sanity it is described as a structure of data-points with a defined meaning. This allows us to use those same data-points to provide an advanced search (give me buildings with 20-30% office space and more than 15% retail), and it has also allowed us to generate books from the exact same dataset that power their web-site.
So, the big hairy goal of a headless CMS is to disentangle the content from its presentation, thereby making the content reusable across many forms of presentations ultimately making the work spent authoring that content more valuable.