Predefined variables in Merge Request Pipeline

Hello,

I am creating a merge request pipeline using the CI. I have a question on the predefined variables to understand the differences.

The official template here suggests using the CI_MERGE_REQUEST_IID but the docs use if: $CI_PIPELINE_SOURCE == 'merge_request_event

My understanding is that CI_MERGE_REQUEST_IID exists only on a MR and it would trigger the pipeline on any change or update in the MR. Is this assumption correct?

Also, what are the differences these two variables and which should be used?

Thanks in advance for the help!