The device is called an audio interface. You connect it to the computer with one of the following: pci (literally a pci card), USB, firewire, thunderbolt, or HDMI.
There are many small USB models to choose from. They range from frugal budget models that still have reasonable modern specs on the analog stages to high end boutique models with class A analog stages. The firewire and thunderbolt connecting models are usually the more pro audio models and usually include more connections, routing, built-in mixing ability, and a host or more pro audio and recording related features. HDMI connecting models should be a last choice. Consumer gear with HDMI connections runs into a lot of products with "copy protection gone wild" approach and can really be a PITA. There's always a better choice in some USB model. PCI cards... well, you'd need a desktop tower machine with a PCI card cage to begin with. The PCI cards are usually either on the ratty cheap end (Sound Blasticator, etc) or the extreme high end (going for minimum latency in live sound systems and that kind of thing). Again, USB connecting devices are where the most choices are going to be available today. And unless you're streaming 32 or more channels back and forth at extreme low latency for live show production, USB will be just fine.
Here are a couple budget models with 8 analog inputs and 8 analog outputs. That covers up to 7.1 surround going both in and out analog.
Tascam US-16x8
https://www.bhphotovideo.com/c/product/1086777-REG/tascam_us_16x08_usb_audio_midi_interface.html/?ap=y&gclid=CjwKCAiAmO3gBRBBEiwA8d0Q4qc5t_gKEu4Uwp1gT5U5Wkw1dm5BPMYKPf0h_lq8M2rhaCxje_G7ABoCBcgQAvD_BwE&lsft=BI:514&smp=Y
Behringer Firepower FCA1616
https://www.bhphotovideo.com/c/prod...uoVltsyZUr2J9cy4hNCmvbrJ7hoCMC4QAvD_BwE&smp=Y
OK, normally I don't recommend B-word products (Behringer). This is one of the newer generation of Midas designed units though. The budget version gets the B-word name instead of Midas. It's not junk! If you don't take it on the road and constantly patch in/out the jacks daily it will be good. (The "cheapness" is it's not robust enough to tour with.)
Both of those products include built-in digital mixers which would allow you to downmix and speaker manage with the unit itself. (Bypassing the computer OS features.) Probably a moot point for any Mac user but it might save the day with a Windows system that doesn't play nice.
Don't buy M-Audio products. Ratty cheap with no redeeming value! Avoid HDMI connecting devices. Too many shenanigans with HDMI with 'copy protection gone wild' style of disabling functionality.
If you want more boutique analog connections (specifically the AD and DA conversion) - maybe you're trying to preserve an old analog recording to the highest potential - look at a used Apogee Rosetta 800 (8 analog ins, 8 analog outs). I've seen them going for as low as $500 on Ebay. You'd need to pay $2500 or more for a new unit of this level of boutique. I've got one of these. Note that this one is firewire only. If you have a newer generation computer with no firewire port but a thunderbolt port, the thunderbolt to firewire adapter would just work. But if you have one of those budget computers with only USB, this would be a PITA to adapt.