Media decoding support is determined by a layered stack: the browser itself, the OS media framework (e.g. AVFoundation on Apple, MediaCodec on Android, DirectShow/Media Foundation on Windows), and hardware accelerators embedded in the SoC. The HTMLMediaElement.canPlayType() method queries all of these.
Results come back as empty string (no), "maybe" (container recognized, codec uncertain), or "probably" (container and codec both recognized). The distinction between "maybe" and "probably" depends on how precisely you specify the codec string — video/mp4; codecs="avc1.42E01E" is much more specific than video/mp4.
H.265 hardware decoding is present on Apple Silicon, most ARM SoCs, and newer Intel/AMD chips, but absent on many mid-range Android devices. AV1 hardware decode arrived with specific GPU generations (NVIDIA Ampere, Intel Arc, Apple M3). This makes codec support a useful differentiator even within the same OS version. Combined with GPU vendor data, it can identify the device generation to within 1-2 years.