Why did Apple change the filesystem? Which HFS+ shortcomings does APFS resolve?
HFS+ dates back to MacOS 8.1, and itself is built on top of HFS. So it's not really built for modern computing as it hasn't really changed much since 1998.
The big things in my mind are:
* Snapshots
* Copy on Write
* Containers instead of Partitions
A lot of this benefits from SSDs. Containers are a form of thin provisioning of volumes. So I don't have to cut a 2TB drive into two 1TB partitions, but rather I can let them share the free space on the drive and each container only uses what it needs. But this means a heavily fragmented drive in the end. Containers make the sealed system volume possible without overhead of resizing partitions/etc.
Copy on write will create more fragmented files, but means less wear or need for deduplication at the SSD controller level on the NAND flash, and makes more space on the drive available for the user. Copy on write also makes journaling easier. So while you can lose data that hasn't been fully written yet, odds are good that the metadata (and the volume) will remain in a good state so long as it's the last thing you do in any operation.
Snapshots are probably the least useful day to day, but back the sealed system volume functionality, since you are booting snapshots that are signed. A malicious actor wanting to modify the system volume has to recreate the seal which is extra work. If I recall correctly, Time Machine has benefited from snapshots as well. But it'd be a good way to snapshot the state you want to backup and not require exclusive access to files you are trying to backup.