I was also wondering about this question after learning electron affinity.
So i found a thought process.
We know from atomic structure topic that , if an electron want to jumps from lower orbit to higher orbit then it absorbs energy. And if the electron jumps to infinity then absorbed energy is called ionisation energy...
Likewise when an electron jumps from higher orbit to lower orbit then it release energy.. so if an electron jumps from infinity to atom orbit then realesed energy is Electron affinity. 😊