Powered devices like a phone have read/write NFC chips that the device will write data to on demand, usually waiting for some form of user auth to make it secure, e.g. an iPhone keeps the NFC chip empty until you specifically request to pay for something, at which point it authenticates you (e.g. with FaceID) and then writes the data to the chip which can then be read by the terminal to authorize payment. Once payment has been made it wipes the NFC chip again.
But a device can have some payment info written to the NFC chip at all times, which is what iPhones do when you have the "Express Transit Card" option enabled – with certain authorized vendors, that payment data stays on your phones NFC chip indefinitely, so you don't need to auth with FaceID and even when the phone is out of battery it can still be read by those authorized terminals.