You would need to check the execution plan.
WHERE ad.AdvertisementID IN (SELECT AdvertisementID FROM UDF_GetAdvertisements)
will be implemented as a logical semi join operator. The physical join type might be any of merge, hash, or nested loops.
Merge join and Hash join process each input once. Nested loops processes the outer input once and the inner one as many times as there are rows in the outer input. But even if the TVF is shown on the inner side of a nested loops join the result might be cached in a spool rather than repeatedly re-evaluating the TVF.