Relationship between bit depth and dynamic range? Is there a direct relationship between higher video bit depth (10-bit vs 8-bit, for example) and higher dynamic range, i.e. HDR?

I'm somewhat confused regarding this particular aspect of bit depth. I know that more bits allows us to capture and recreate more colors and their shades, but where exactly does dynamic range come in?
More bits mean more possible values for each channel. So each channel in an 8 bit image has 256 possible values, from 0 to 255, while a 10 bit channel has 4 times as many: 0 to 1024.

Dynamic range however is the range between the brightest sample a sensor chip can encode and the darkest - it is a property of the sensor. So you could conceivably have an 8 bit sensor with a wider dynamic range than a 10 bit sensor if it could resolve very bright and dark images, it would just have fewer steps between these than a 10 bit sensor with the same dynamic range.