If a country you are planning to visit needs you to have a Visa to enter the country then there are generally two ways of obtaining it… 1. You apply and acquire the visa in advance to be sure that you will be granted entry into the country, 2. Where you are allowed to travel to the destination country under the assumption that you will be granted the Visa to enter the country. Visa on arrival is granted when the person arrived at the port of destination. There are offices at the arrival in such airports which issues a Visa as per the visa rules (provided everything checks out and you are not on any kind of travel restriction to that country). The Visa usually has a fee that has to be paid there and then and you can then proceed with the passport control or walk out of the airport.
Visa on arrival is convenient as you may not need to obtain it in advance and if your plan was sudden then you may not even have time to apply and obtain the visa. In such cases, Visa on arrival is very convenient. There is however a Caveat that, you may be denied the visa once you arrive at the destination airport. If you are for any reasons, on restricted entry or travel list, then you may be denied the visa and it will be highly inconvenient to return back to your own country or any other country where you could be allowed an entry.