Travellers from many countries don't face this experience due to visa-free / visa-on-arrival arrangements. However, everyone else - and this is just not travellers from 'smaller' countries but even big ones such as India and China (just to mention the two most populous countries in the world) - often have to apply for a visa in advance. Even then, many visa application require applicants to hand in documents in person, with no option for postal applications.
I've had situations where I needed to make visa applications in advance. I had the choice of making postal applications, but for security of my documents I often get these done through specialised visa agencies instead. You haven't mentioned where you are from, so I cannot suggest specifics. I have used CIBT in the past and they have branches in multiple countries. What specialised visa agencies do is receive your documents, and then use secured channels or messengers who can personally submit your documents. Depending on what country you're applying for (Burkina Faso, for instance, is one country you'll probably have pay a travel agency specifically look into for visa procedures.)
Whatever you do - send to an agency or yourself - always use a courier service or a 'secure delivery' postal services. In the UK for instance Royal Mail offers 'Special Delivery' that requires delivery to be signed for, as well as automatically insuring contents of package up to a certain amount. Check whether the courier/postal service you use has this insurance coverage - if it does, then it's in their best interests to ensure such packages don't get lost otherwise their operational expenses on insurance will go up. And if somehow a package does get lost, you can claim cost of passport replacement from them.