Both. CMOS stores BIOS configuration information. When you "enter setup", you are running the BIOS's configuration program, which loads the settings defined in CMOS. You are "setting up" the CMOS, by providing configuration information the BIOS will use as it runs.
The BIOS is a program written as Firmware onto a ROM, so it cannot be written to (except by an all-or-nothing flash operation, which is dangerous, so not an everyday operation). The BIOS ROM stores its configuration info on to the CMOS when you hit F10. That's why clearing the CMOS restores your BIOS settings to default, and is why it doesn't delete the BIOS iteslf, leaving you with an expensive paperweight.
In example, the BIOS has a subroutine that will load the OS per the boot order. the boot order information however, (eg use first CD-ROM as first device) is stored in the CMOS. If you clear the CMOS, the BIOS will use a default, usually the first disk on the first disk controller that is populated.