Those numbers aren’t directly comparable — caches usually trade off size for performance, and Apple’s L1 sits in performance somewhere between Ryzen’s L1 and L2. Ditto for Apple’s L2 versus Ryzen’s L2 and L3.
I can’t remember the exact article I read that in, but it’s pretty obvious when looking at Anandtech’s latency charts.