"The block number or timestamp at which this transaction is locked, or 0 if the transaction is always locked. A non-locked transaction must not be included in blocks, and it can be modified by broadcasting a new version before the time has expired (replacement is currently disabled in Bitcoin, however, so this is useless). "
This is the reason why this 500 000 000 is in the condition: if nLockTime is smaller than that, it is assumed to be a block number, otherwise it's assumed to be a timestamp.
If this is not the case and nLockTime is for a time in the future for example, every input from that transaction will be checked, which does this:
{
return (nSequence == UINT_MAX);
}
If the sequence number of every input is equal to UINT_MAX then this transaction is considered final, even though the nLockTime refers to a future block/time.
The reason why this is done is because as long as nLockTime refers to the future, the creator of this transaction can make new versions of it. This is done by increasing the sequence number of the input. If every input has UINT_MAX as sequence number, no new versions of it can be created anymore as otherwise it would result in an overflow.
I hope this helps. I can't guarantee how correct this is, but this is just what I read from both the wiki and the code