Tell me why we need themes and when is it better to use them?
For the same, for what and in WordPress: to provide the possibility of different designs of the same application without the need to rewrite files. Also, themes can be used to implement template inheritance: when defining templates in the default application folder, you can override them with templates in the themes folder, and thus display the changed view in the default layout and vice versa.
Why not just use the view to separate the static parts of the page (header, footer)?
Because in Yii, the choice was made in favor of the general template (layout) and widgets. Arbitrary places in the template still come up against the need for widgets, and the static parts simply become unnecessary burdens - they are easier to arrange as widgets and don’t waste time supporting an unnecessary entity. Not to mention the fact that in a serious application there are always some promotional pages where everything is turned upside down, and here it is easier to write a separate layout. Well, no one bothers to connect individual files in the layout.
And also, is it possible to ask several topics?
At the same time - no, to set an arbitrary topic when requesting - please:
Yii::app()->theme = 'default'; // используется тема default.
But, in general, this does not make much sense, this functionality is extremely rarely required.
Suppose for the site itself, and then for the admin panel?
It is possible, but I would not do that. You need to set the subject either in the config or in runtime, and this may just be superfluous information. On the other hand, if you have different configs for the admin and frontend, then why not unleash the visual presentation.