All of this still needs to be solved in a modern system, but for the most part the hardware, firmware, and OS will sort things out by themselves—even if some of the details of that process are liable to give you nightmares[3,4]. The iMac, for its part, solved this by not having any expandability at all (ISA or PCI), so the settings could be burned into the firmware.
[1] See e.g. https://tldp.org/HOWTO/Plug-and-Play-HOWTO.html
[2] I don’t think this was ever a problem for address ranges for memory-mapped I/O, UMA issues excepted,—perhaps because MMIO didn’t really become popular until PCI won and ACPI appeared?
When you installed a card like Sound Blaster so your PC games could actually play some passable music and sound effects, you’d configure these settings with physical jumpers on the card. And then you have to pass those configuration settings to the game somehow so it can send data to the device.
You could leave the card to its default settings, but then it might collide with another device like a printer or whatever.
IRQ is short for "Interrupt Request" and each peripheral or device that needs to interrupt the CPU for time-sensitive processing needed to be assigned one. There were only 16 of them with several hard coded for certain things like RTC. Since each serial port, parallel port, floppy controller, HDD controller, video card, sound card, etc needed an IRQ assignment it was not unusual to run out of free ones and resort to overloading one or more. This was less than ideal as now multiple drivers are waking up unnecessarily for the same IRQ.
Originally these were set with physical jumpers on the motherboard and expansion cards. Most things switched to being configured with software/BIOS when the industry moved to PCI bus.