It has been discussed here before a few times, but it is complicated. Customs and passport checks are two different things. Here are the gory details. It all ruled by 3 things.
- Have you got a through booking to the final destination, or two separate tickets?
- Are both countries in the EU?
- Are both countries in Schengen?
1) If you have a through booking, your luggage will be booked through to your final destination, you won't see it until then and you will only go through customs after you collect it at your final destination. If you have made two separate bookings (usually not recommended), then you need to collect your luggage at the first destination, go through customs, and then check it back in again.
2) There are no customs within the EU. Flights within the EU (London - Berlin or Amsterdam - Berlin) have no customs. But they know which bags originated outside the EU (different luggage labels).
3) There are no passport checks within the Schengen Area. Most EU countries are in Schengen, but the UK is not.
If you fly Somewhere --> Amsterdam --> Berlin, Amsterdam --> Berlin is a Schengen-internal flight, no passport control, so you will go through passport control at Amsterdam, that will be your entry point to the Schengen Area, then no passport control at Berlin.
But, if you fly Somewhere --> London --> Berlin; the UK is non-Schengen, so you stay "airside" in London, never enter the UK and have passport control into the Schengen area in Berlin.
That is of course assuming you have a through booking, if not you have to enter the UK (passport + customs) and check in again, back out through passports.
Confused? Overwhelmed? This should be in a FAQ somewhere :-)