Customs, immigration and airport security checks are three distinct processes you may encounter at an airport or border crossing. Sometimes you may have to go through all three, other times you just encounter one or two and other times you won't go through any. It all depends on which countries you're traveling between. For instance, when you travel between Belgium and the UK you go through immigration, but not customs. When you travel between Belgium and Switzerland you go through customs, but not immigration. If you're flying between Belgium and Finland you would only go through security, the same as you would if you were flying between Florida and California. Confused yet? Here's a quick guide.
Security is what you go through before boarding a plane (or a train in the case of the Eurostar). It is run by the airport or transport safety authority and has nothing to do with customs. They are screening your luggage for weapons in order to protect the plane. They are not screening for undeclared goods or for illegal drugs. It is purely related to protecting the mode of transport you have chosen, usually an airplane, and is done for flights within countries as well as between them.
Schengen agreement, which means there is no immigration check when you travel between them (meaning you don't show your passport to an immigration officer). These countries are actually not allowed to make you show your passport in order to pass between them.
Two countries in the EU - the UK and Ireland - have opt-outs from participating in Schengen. So you must show your passport when traveling between these countries and the rest of the EU. Bulgaria and Romania are now in the EU but are not yet in Schengen - they are in the process of joining.
Incidentally this also means that if you are from a country without a visa-waiver agreement for Europe (South Africa for instance), you can visit all the countries in the Schengen zone by getting just one Schengen visa. But if you want to visit the UK or Ireland on that same trip, you must apply and pay for a separate visa.
Customs is the process that controls the goods you are bringing into a country and levies charges on them. This is the step where a customs officer can search your bag, and you might be in trouble if they find cash or goods that you haven't declared, illegal drugs, or improper agricultural products. You can either choose to declare what you have, or you walk through the 'nothing to declare' line where they selectively stop people to check their luggage. In all my years of flying I have never been stopped at customs. Ever, in any country. Chances are you haven't either.
The EU is one customs zone, meaning there aren't restrictions on what you can bring in between the countries. So when you travel between EU countries, they are not allowed to search your luggage for customs-violating goods. There wouldn't be any reason to anyway, as there aren't restrictions. This is why some airports have the 'EU' line to walk through in customs. If you are stopped there, and you show your ticket showing you have come from an EU country, they cannot search your bag. Turkey is also part of this zone (the only non-EU member).
This also means that you cannot get duty-free goods if you're traveling between EU countries. This is why they scan your ticket if you're buying duty-free goods, to make sure you're on a flight leaving the EU. So when I fly home to the US, that is the time I can get goods duty free. But I can also get them when I'm flying to my dad's house in Switzerland - because Switzerland is not in the EU and therefor not part of the customs zone.
But even though Switzerland is not in the EU customs zone it is in the Schengen Zone, along with fellow non-EU (or pseudo-EU if you want to get real) countries Norway and Iceland. That means when you fly from the EU into Switzerland you will not have your passport checked, but you can have your luggage checked - and there is a limit on what goods you can bring into the country. There is also a customs levy charged on goods coming into the country - which is why mailing something from Belgium to Switzerland is so much more expensive than mailing something from Belgium to the UK.
Why is any of this important? Well for one thing it's helpful to know when you need to bring a passport, when you can buy duty-free items and when you have to worry about what goods you have in your luggage. But it's also a good thing to know your basic rights as an EU citizen and as a traveler. And it's also helpful to not send me into a rage if you're telling me a story about your experience at 'customs', when it is actually immigration or airport security!