Apple says:
Depending on the device and orientation, the system displays either a regular or compact tab bar. Your app should include custom tab bar icons for both sizes.
Unfortunately, they fail to specify when you get which.
Also I might include those images for both sizes, but will the system switch between them automatically (how?) or do I have to do it myself?
You should not do this yourself system can do it automatically.
here is Apple Human Interface Guidelines, where you can find icon resolutions: https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/custom-icons/
for example: If you are using circular icons for tab bar item you should create following sizes for portrait mode:
and for landscape mode:
after you add this icons into Assets.xcassets or somewhere, you can select Tab Bar Item icons from storyboard:
select Tab Bar item and in the attributes inspector, choose portrait image for image field, and landscape image for landscape field.
After that system will do everything for you.