Most countries around the world engage in some level of 'protectionism' and have various customs duties, taxes, cesses and so on, to protect their own industries and businesses; and in addition, governments also wish to earn income via customs duties etc, on goods being imported and/or exported to and from various parts.
obviously, the volume funds involved in such customs transactions and in evaluating/assessing and monitoring customs flow, is often quite huge, in many countries-- and as such, there is always a dire need to have a very high level transparency and fairness/accountability of customs procedures (i.e. laws and processes) and management/adminstration of such services. Most countries around the world try their very best to maintain such standards.
However, it is impossible to ensure 100% full reiance on such systems, given human nature and the incentives involved; and especially in developing countries, various customs laws/regulations, processes and management and administration 'on ground' is often quite faulty and /or corrupt. This is generally bacause of a number of factors eg (a) poverty/low salaries of customs officials in such nations (b) lack of proper training /knowledge and planning and other forms of procedural systems and so on.
A small case study as shown in the link below might be helpful to illustrate some of the points in this regard.