It's more complicated than that and you've got your math wrong.
A bit is on or off -- 2 states so 0 or 1, 2^8 = 256. However in the 8 bit JPEG format each pixel has an R channel, G channel and B channel so 256 x 256 x 256 = 16777216 possible colors per pixel.
In a 14 bit raw file each pixel is not RGB but rather just R or just G or just B. 2^14 = 16384 possible values for each color. The file structures are different. And so you're not comparing like units. The data in a raw file is linear while the data in a JPEG file is non-linear and that's a world of difference.
Think of a yard stick. It's marked off in inches and all inches are the same -- 36 inches in total. That's a raw file. Now let's think of a JPEG stick. We can't use a ruler, or yard stick or tape measure as an analogy because the JPEG stick has units of varying length. The data storage is non-linear. As such it's possible that a JPEG stick and raw stick are both equal in total length even though one is 8 bit and the other is 14 bit.
It get's worse, not all raw files have same size units. They all store linear data but not in like units. Think of a staircase -- a 14 bit raw file will have 16384 stairs while a 12 bit raw file will have only 4096 stairs. And yet it's possible that a 12 bit raw file from camera X is capable or recording data over a total range that is greater than the 14 bit raw file from camera Y. Two different staircases reaching different heights and with radically different spacing between stairs.
When you're not comparing like units you're not comparing anything.