CPU usage constraint in docker-compose

The CPU limit as explained in the docs mentions that 0.5 indicates 50% of available processing time. That is a bit ambiguous to me. Is it available CPU time in user space? If I have 4 CPU cores, does it mean that 2 CPU core worth processing time is available to the container? If another process starts spiking in CPU usage, how is 50% ensured?

If there is any relevant documentation on it, please feel free to share.