In Spain they want to collect taxes also for the shipping. They even try to justify why this makes perfect sense. If the shipper fills the custom declaration with just the product price, you may get away with it, but if you show the full bill, even if the shipping is a separate item, they'll calculate taxes over the total amount.
With China it isn't usually an issue, as the shippers usually fill custom declarations with whatever concept and value they like that particular day.
In the UK, and I think all the EU, the threshold of whether it gets charged is on the declared goods value (I think around GBP18 for goods, GBP36 for gifts
If it exceeds that they charge import duty (usually minimal for electronics) and VAT on the declared goods value PLUS the value of postage PLUS the handling fee (GBP8 for Royal Mail in UK)
The argument is that if you buy something in a local shop, the price includes the cost of getting it to that shop.
Unfortunately a lot of sellers (especially in countries with high tax-free thresholds like US and Australia) don't understand this, and include shipping cost on the customs label, so it gets charged double.
For low value goods, it is especially annoying if the seller's inclusion of shipping cost takes it over the duty free threshold. as this can nearly double the total.