Look at this from this POV:
- Apple started on custom ARM many years ago.
- Apple isn't really smaller then Amd, and Amd also rewrote and restructured their architecture some years ago.
- Apple hired many greatly skilled people with experience (e.g. which worked before with Intel)
- Apples uses state of the art TSMC production methods, Intel doesn't and the "slow" custom chips from China and Russia don't use that either as they want to have chips controlled by them produced with methods controlled by them. (TSMC production methods are based on tech not controlled by Taiwan).
- Apples had a well controlled "clean" use-case, where they bit by bit added more support. This includes that they could drop hardware 32 bit support and don't have any extensions they don't need for their Apple products, this can make thinks a lot easier. On the other hand x86 has a lot of old "stuff" still needing support and use cases are much less clear cut (wrt. thinks like how many PCI lanes need to be supported, how much RAM, etc.). This btw. is not limited to their CPUs but also (especially!) their GPUs and GPU drivers.
So while Apple did a grate job it isn't really that surprising.