IRI keeps track of txs which are missing. The node will fetch the hash of one of its missing txs and ask a neighbor whether he has it. If the neighbor has it, it will remove the tx from its missing list after receiving it. If the neighbor doesn't have it, the node will give it another try when the tx gets selected again (could be a different neighbor this time).
However since the tx might be really non-existent (e.g. a tx specified a bogus trunk and/or branch), IRI has built in something that when selecting a missing tx, it already removes the tx from the missing list with a small probability (like 1%). This way the missing tx-list is regularly purged from bad/non-existent txs. A restart clears the complete missing list of course.