What does Publish actually do

What’s the purpose of publish?
What changes with the state of the ds?

As soon as you publish a dataset, it populates an FQTN.

Until you publish, the dataset exists, but is in “draft” state which means there is no FQTN assigned and you can still edit the transform logic.

Publishing also establishes a proper lineage and dependencies behind the scenes, but the biggest difference you will notice in the dataset object is that it will get a resource_key and fqtn.