How does AirTag calculate the relative position from an iPhone?

Solution 1:

It is possible to determine the angle because the AirTag has a carefully designed antenna emitting a signal in essentially all directions. When the signal arrives at the iPhone, which is responsible for the angle calculation, the pulse amplitude will vary according to the angle in which the signal arrives at the iPhone antennas. Carefully created software can then use the measured amplitude values to calculate the angle.

Note that this is by no means a simple task, as it concern handling input at high speeds from two or more antennas and correlating information to determine when the same emitted signal is received by the antennas at different times. As far as I know, the AirTag also transmits at two different UWB frequencies at the same time - presumably to alleviate inaccuracies due to multi-pathing.

Note that the software also has to keep track of the phone’s own movement under use. I.e. if you rotate the phone, the angle shown to the user should be compensated for that. This is quite simple, and it is not in any way necessary for the user to move the phone around in circles in order to do the localization.

As for distance measurements, that is actually not calculated based on the signal strength itself as you speculate, but rather it is done by measuring time of arrival (i.e. Time Of Flight based localization).