Dropped frames during playback of 4k/2160p video on Mac mini 2014
The issue is that the the HEVC/H.265 standard is very new, and while there is software support, there hasn't been an update to the Mac mini in a very long time, so there is absolutely no possibility that this has a hardware codec. However H.264 has been around for a long time and there will almost certainly be a hardware codec for this on every device since at least 2010 I would imagine.

Effectively the only way to decode H.265 videos would be for a software codec to use the CPU, and possibly the very limited GPU power in this machine to process this and that is why your computer will be struggling to playback H.265 and not H.264.

There some more details about supported hardware on Apple's website here.

Also worth remembering is that 4K support on most older Mac hardware is limited, and while your 2014 machine supports it, there will be no HDR, and only 30Hz / fps screen resolution on this, further details on Apple's website here.