This is configured by setting the period and quota for the CFS scheduler on the cgroup (encompassing all processes within the cgroup in aggregate). The period identifies how large the time slices are, and the quota says how much of the time within the slice can be used. So if you set it to 2.0 on an 8 core machine, it could use 2 cores at 100%, all 8 cores at 25%, or all sorts of variations as long as the quota for cpu time within a period is not exceeded. A decent description of the fields can be seen in these docs.
The actual files showing these settings is changing with cgroups v2, so some of these files may look different for your environment:
$ docker run -d --rm --cpus 1.5 --name test-cpu busybox tail -f /dev/null
$ docker inspect test-cpu | grep -i cpu
"Name": "/test-cpu",
"CpuShares": 0,
"NanoCpus": 1500000000,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"CpuCount": 0,
"CpuPercent": 0,
$ docker exec -it test-cpu /bin/sh
/ # cat /sys/fs/cgroup/cpu.max
150000 100000
See this answer with examples from cgroups v1.