It is possible to determine the angle because the AirTag has a carefully designed circular antenna - i.e. emitting the signal equally in 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 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.
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).