Those states are part of the dataTables library, which is not something I created, but that I implement for easier viewing/filtering/sorting of table data, along with its export/print functions. So, I didn’t code any of that.
There are a few settings you can set in my plugin, such as enable/disable grouping, and whether or not to show empty slots. Those options are read and used in the javascript initialization of dataTables, so those are the “default” state. There is not a separate dataTables init function for each sheet, since sheets are dynamic and there can be thousands of them. There is just one init function for dataTables that is applied to any table with the particular class I added.