(2-part post):
The following applies to all purchases from non-EU countries. (If you've avoided the charges you've simply been lucky).
The first thing that happens is that the package is checked for the presence of a CN22 customs declaration form (or CN23 if the goods are valued at over £270 but under £2000). If that's not present your package can simply be seized without compensation.
Then Customs Duty is calculated, based upon the purchase price of the goods, including the postage and packing charges (except that postage is excluded from the calculation for bona fide gifts). The rates vary widely, depending upon the type of goods. For example there's no tax on books but cotton-based clothing is charged at 12% (unless it's from the USA, which is currently breaching World Trade Organisation rules by subsidising US cotton farmers; then the rate is 27%). See the 'Standard duty rate' column in this document for other rates:
http://tinyurl.com/9jlnc
However if the amount of duty calculated comes to less than £9, the whole of the duty is waived. (It's also waived if the value of the goods is less than £135)