An ability exists on the stack independently of its source. Removal of the source after that time won't affect the ability. Some abilities cause a source to do something rather than the ability. Any activated or triggered ability that references information about the source checks that information when the ability is put onto the stack. Otherwise, it will check that information when it resolves. If the source is no longer in the zone it's expected to be in, its last known information is used.