It is an annual immigration visa lottery through which nationals of countries which the U.S. considers to be under-represented through other immigration channels, can apply for legal permanent residence in the U.S. Foreign nationals can apply from outside or inside the U.S., but those who are unlawfully present in the U.S. will not be able to adjust status even if they win the lottery.