OK, this might be getting confusing due to the backwards leaning of it.
When building, you have to build everything. There’s some preprocessing that can be done at a previous time. But the actual build still needs to do a full build.
When doing that build the build processor needs to be told every little thing that must be included in the build. Everything.
Who ever engineers the build process decides how the build process determines what everything is. Usually for resources in the game, there’s a resource resource file, or a resource directory, or heck even a resource project. And the build process for each resource needs to be defined as well (textures get processed this way, models that way, a specific model might be processed differently from another… so on, so forth). And of course, if a resource is not used in the project, you don’t want to include it in the build.
This is called the ‘build pipeline’.
It’s a pipeline because there are several steps to it, that must occur in a specific order.
Note, lets look at some old games, like Super Mario, Zelda, and the sort. Hackers have torn apart the code and pulled resources for sprites out of it for things that don’t exist in the games. These resources ended up in their because their build pipeline was including resources that should have not been included in the final build. Thing is… this was back when games were meant to fit on expensive ROM chips that were very small in storage space. These unnecessary resources ended up increasing the size of the ROM for no reason. This may be because someone forgot to remove it from what ever system they use to determine necessary resources.
In unities case, they wanted to make it as easy as possible for the user. So instead of requiring all resources to placed in some resource directory, or resource project. They instead decided they’d just infer what resources are needed by searching through the scenes and seeing what scripts/prefabs/models/etc were included in the scene (either by reference, or by direct instantiation in scene). Now we have a list that ONLY consists of the resources needed, making for the most compact build possible to make the game run.
Remember, compactness is important… you may be deploying to platforms like iOS or Android where there is limited storage. Or printing to CD/DVD which has a finite size limit.
Thing is… this means that EVERYTHING you use needs to be in a scene. It doesn’t allow for ‘dynamic’ loading. What if the scene gets populated with characters based on a choice the user made, and the choice could be from a list of 100 characters. Why load all 100 characters into memory just to be in that scene???
So Unity included a way to allow you to define the resources you want to include in the game. They reintroduced the ‘Resources’ folder. What otherwise would have been required, unity only uses for when unity otherwise can’t figure out what resources are needed (see @StarManta 's previous post).
The only other option would be to include the ENTIRE project. Which is ridiculous. Then we’d end up creating the fattest/least efficient build of the game since every unused asset gets included.
Note… when working on large projects tons of assets may exist that aren’t actually critical to the game. It may be assets used for editor stuff. Or old versions of assets laying around because some designer wanted to be able to look at it easily. How do we include these assets in our project, while not including them in the build???
Well, that’s what the Resources folder does.
Basically… if it’s not in a Resources folder, but is used in a scene, it gets included, otherwise it doesn’t. If it’s in the Resources folder it always gets included.