The impression I get is that CP/M relied on the BIOS, provided in ROM with the computer, for all the hardware-specific functions.
No. Usually only a Bootloader is present in ROM. The BIOS is the hardware dependent part of CP/M (*1), loaded from the boot disk. It was the PC who established the rule to have BIOS in ROM by default (*2).
So if you bought CP/M, you didn't have to specify what computer you had; the same discs would run on any computer with a suitable BIOS...
Of course you had. Well, you didn't when buying an already adapted one from your machine's manufacturer. But when buying a genuine CP/M from DR, you received a BIOS example file and had to tweak that to include whatever hardware your machine had.
... almost; unlike MS-DOS, CP/M supported multiple CPU architectures
So did MS-DOS, including 8086, V20, 80186 and so on.
including 8080, Z80 and later 68000. So you would have to be sure to get a version suitable for your CPU.
No, well, yes in case of 68k, but Z80 (*3) just used the 8080 code. Keep in mind, CP/M-80 (*4) is restricted to only use 8080 code. That way it can boot on any 8080 compatible machines (*5). Machine vendors could (and sometimes did) use instructions specific for their CPU (like Z80) within the BIOS, or applications, but BDOS and CCP was always strict 8080 code (*6).
Is this correct, or was it more complicated than that?
Incorrect and, as shown, way more simple :))
*1 - CP/M consists of BIOS (hardware dependant OS - today this might be called drivers), BDOS (hardware independent OS) and CCP (command line processor).
*2 - Or more correct, even PC-DOS kept that structure. When booting IBMBIO.COM (IO.SYS for MS-DOS, DRBIOS.SYS for DR-DOS) was loaded first providing a wrapper around ROM BIOS. This layer was rather thin in the beginning and mostly intended to allow for future extensions - which happened a lot after DOS 2.0, as IBMBIO.COM now contained all basic device drivers. After that, IBMDOS.COM (MSDOS.SYS for MS-DOS, DRBDOS.SYS for DR-DOS) as OS Core was loaded, followed by COMMAND.COM.
Some MS-DOS machines, like the SIEMENS PC-D, had also only a bootloader in ROM and IO.SYS contained the whole BIOS code.
So bottom line: PC-DOS works exactly like CP/M, except that in the beginning most of the BIOS code was already in ROM, so no RAM had to be wasted for this.
*3 - And other 8080 compatible CPUs.
*4 - As it later was called when other CPU architectures where supported.
*5 - Given a sufficient BIOS is on disk.
*6 - One reason why ZCPR is so hyped - it is Z80 optimized :))