mine h265 has smaller files sizes due to converting his vid format, of H264 base (most internet still using it and known as HVC) into a more newer, advance and optimized H265 base aka HEVC format, that purely made for running 4K vid format with higher bitrate. the technical stuff pretty long howver u can take it as a newer codec function to run 4K smaller storage file sizes, but it does uses quite a lot of CPU processes depending on ur cpu generations.
another good contender for HEVC is AV1 unfortunately converting using AV1 still heavy cpu utilization and not many old devices support AV1, unless past years flagship devices...
anyway a guy on yt, AltRepo made great vid explaining these,