8-bit h.265 has higher-precision motion vectors than 8-bit h.264, which is why h.264 does get a significant benefit from using 10-bit for 8-bit video, even if you will eventually display it on an 8-bit display.
8-bit vs. 10/12-bit
There may still be some gains in compression efficiency for x265, but they're definitely smaller if they exist at all. 10 or 12-bit might even look a tiny bit worse. (But See discussion on doom9, linked by Michael in a comment. I haven't followed the latest discussions, so I'm not sure what the current consensus is on 10-bit x265 for 8-bit video. Even if there is a small gain, it may not be worth the speed penalty.
It's definitely nowhere near a factor of 12/8 like some commenters are suggesting based on "simple math". A lossy video codec like h.265 isn't very similar to simple lossless compression like ZIP.
x264 does benefit in general from running in 10-bit mode even when the original source is 8-bit, and so is the final display (but again, you shouldn't expect the same CRF to give the same bitrate or the same quality at different depths). 8-bit h.265 has higher-precision motion vectors than 8-bit h.264, so that part of the reasoning doesn't apply to x265.
Remember that both h.264 and h.265 store the information in the video as quantized frequency-domain coefficients. With trellis / rdoq, it even tweaks the quantization to compress well with the final entropy-coder (e.g. CABAC in h.264), so the same number of bits can represent the same amount of information, whether the entropy-coder had 8-bit or 12-bit input. 8-bit is in some ways just a speed-hack.
More bits means that you can get closer without(smaller error) while still having all the bits identical, sosome error. So the encoder has more choice when trading off distortion vs. bitrate. This may be partly why 10-bit x264 suffers less from "banding" artifacts in gradients: it has more choice in representing the DC coefficient, or in having small values in the AC coefficients.