The restriction to 4 primary partitions is part of the old BIOS, now
removed in the new Unified Extensible Firmware Interface.
If there are fewer than 4 BIOS partitions an Extended partition can be
created. This cannot be used by itself but can contain an (almost)
unlimited number of logical partitions. These function the same as primary
partitions and are indistinguishable from primary partitions to the end
user.
At least that's what I taught my students 15 years ago, if memory serves me
correctly!