Within the EU there are different VAT rate for each member state. Once an online retailer from one state sells over a certain value of goods per year to customers in another state then that retailer has to register for the second states VAT and collect it from the customer before passing that on to the foreign country.
Below that level then the VAT collected remains at, and goes to, the sellers government. I cannot remember what the level is but it's only in the small 10 of thousand Euros per year range, so the likes of Amazon.co.uk is easily selling above that level to pretty much every other EU state, or there is a local Amazon.co.XX that will make the sale instead.