The military has known for generations of the issues related to occupying enemy territory. All of the “hearts and minds” stuff is in regard to that. Therefore, it’s the necessary civil part of a military operation, and it’s even a part of the military pre-planning.
War is politics carried out by other means. War is entirely political.