Tell me please, why is .iml needed in Java?
The second question is, where is it stored if it is displayed in IntelliJ IDEA, but in fact it is not in the project folder?
The IML file is a module settings file created by IntelliJ IDEA, an integrated development environment (IDE) used to develop Java applications.
It stores information about a development module, which is a Java, plugin, Android, or Maven component of a Java application.
Here you can read what is .iml file