Question about IoMarkIrpPending() in completion routine

so I watched a video tutorial on a filter driver using this code in the completion routine:
if (Irp->pendingreturned)
{
IoMarkPending(Irp);
}

If the bottom driver returns STATUS_PENDING, and the IRP is marked as pending on its way up, then how does the IRP get completed? What happens to the IRP after it is marked as pending? Does it just hang there?

When the IRP is left pending, it’s a contract that SOMEBODY handling the IRP, eventually, in the future will call IoCompleteRequest on it.

Marking the IRP pending, and returning STATUS_PENDING are ways we tell the I/O Manager “I am not completing the IRP now… somebody will complete it later”… this lets the issuing continue running (optionally) while the I/O is in progress.

Peter