Maps and YouTube are from the same developer which means they're allowed to setup shared storage on your device and in iCloud, and google surely uses that to store a unique identifier. So there's nothing you can do to stop them being linked.
For safari, they do that by setting a cookie and comparing it with your IP address. Once you use a google service in safari from a few different IP addresses, and also use maps or youtube in those locations, they correlate the data and uniquely identify you from then on. Safari will block this technique on iOS 15 if iCloud Private Relay is enabled.