How it's calculated:
First, Customs Duty is calculated, based upon the type of goods and their value. The rate charged varies widely depending upon the type of goods, with many electrical gods only carrying a rate of around 2½% but cotton clothing being charged at 12% (or 27% if it's from the USA as there's a penalty on US cotton imports because the USA is in breach of World Trade Organisation rules by subsidising cotton farmers).
However Customs Duty isn't charged if the value of the goods is less than £135 (so you got away with that bit!). Customs Duty is also waived if the total arrived at comes to less than £9.
Then VAT is calculated. VAT is charged on the goods, on the carriage charges and on the Customs Duty (if any, and yes that is a tax on a tax!). However VAT isn't charged if value of the goods is less than £15.
So it looks as if you were let off the VAT on the carriage charges, as you've only been charged 20% of £22.63 = £4.52 (when rounded down).
Lastly, there's a customs examination fee of £8 payable to Parcelforce Worldwide (who carry out routine customs examinations on behalf of HMRC). That fee is only waived if there's neither Customs Duty or VAT to pay.
So you ended up with a bill of £4.52 + £8 = £12.52.
As a summary, you can only avoid paying hefty fees when you buy from abroad if
(a) you buy from within the EU (in which case you won't be charged anything unless you're importing alcohol or tobacco products, which attract Excise Duty) ; OR
(b) you buy items which are valued at less than £15 (e.g.you can import a single CD without paying charges but you'll get hit if you buy lots of them together) ; OR
(c) you purchase items which don't carry VAT, such as books.