What is the function of the "out" and ".idea" folder in Intellij?
When you use a JetBrains product such as Intellij Idea all the project specific settings are stored in the directory .idea. Here is a link from JetBrains documenting .idea directory: Documentation.
As for the out folder it contains all your compiled classes, when you run your program from the IDE, all your classes are compiled in the out directory.
Read official doc here :- .out :- .out folder intellij
And .idea :- .idea folder
In Short all the project specific files goes to .idea folder and it will be recreate if you delete the project.
And .out folder contains the output of your project when you build/compile it ie contains .class files.