A visa is basically the request for permission to enter and remain in the country within specified constraints (such as time frame for entry, limit on the time spent in the country, and a prohibition against employment). However, a visa is subject to permission of an immigration official at the time of entry, and can be revoked at any time.
Some countries do not require a visa as a result of reciprocal treaty arrangements. For example, the visa reciprocity policy in the European Union (although it has not yet reached full reciprocity for some EU citizens in some countries).
A visa application in advance gives the country a chance to consider the applicant’s circumstance, financial security, reason for applying, and details of previous visits to the country. A visitor may potentially be required to undergo and pass security and/or health checks upon arrival at the border. Most countries demand strong evidence of intent to return to the home country due to potential unwanted illegal immigration.