SugarCube's State system keeps track of every story variable ($) and its value in every moment (passage) in your story, and the save system saves those variables and only those variables. You can turn the history tracking off, but you'll lose the ability to go back and forward in the story. Variables that aren't story variables are not tracked by the State system, are not saved, and are not adjusted by history navigation.
So if you have a bunch of data that is essentially constant, immutable, or just doesn't need to be saved, you can just use JavaScript variables. This prevents the State from tracking them but doesn't prevent them from being available to multiple passages like with temporary variables (which also might work here, depending on how you've got it organized).
The setup object is provided by SugarCube for authors to use, meaning it's guaranteed that it'll always be empty and not used by SugarCube itself in future updates, so it's generally a safer place for your JavaScript variables than in the global scope or in your own namespace, but there's nothing otherwise special about it.
As to why you'd want to do this, it's mostly because tracking those variables can (eventually) have a performance cost as stories grow, so it's a good habit to be in, and it keeps your saved data small, which can be important on mobile devices with limited browser storage.
I don't want to overblow the performance or saved data size benefits, it is negligible for most stories. I just think it's a safer way to do things. When in doubt, though, use story variables; it's generally less of a pain to track something you don't need than to need something you didn't track.