What's the difference between H265, x265, x264, H264 and which of these uses GPU instead of CPU and how to use H265 GPU NVIDIA acceleration in ffmpeg?

I’m not sure if x264/5 use CPU and ifh264/5 use GPU and also if h265 is basically HEVC_NVEC for NVIDIA GPU acceleration. So, if you could give me more info about these encoding types it would be great. I understood that, summing up a lot, x26* use CPU and are slower but more accurate while h26* are the opposite but h265 is the most recent and optimal trade off. Furthermore, I was trying to convert a video using GPU acceleration and my question is:

Does the following command tell to the GPU to use h265 to encode a video holding the same audio and at upgrading it at its maximum video quality? Furthermore, are there other ways to express the same command?

ffmpeg.exe -hwaccel_output_format cuda -i “input” -c:v hevc_nvenc -preset medium -rc constqp -qp 0 -c:a copy “output”

What GPU are you using? Most newer GPUs will do HEVC (h265)