Take as an example the secrets example. Rough flow:
1) Your declarative code sets up a new Secret object in secretsmanager, which means that when the Pulumi engine runs, that value will be confirmed/created/updated in secretsmanager.
2) Later in your Pulumi program, you want to use that value. The Pulumi engine hasn't run yet (it runs after all your code is run, and it has fully built the resource tree from your code), so you can't query the value from secretsmanager: the value isn't there yet. The value is in your code though, since you have the code that puts the value in secretsmanager. So you get it from there, instead.