To elaborate on what the previous poster mentioned;
Customs is about what stuff you are moving across borders whereas immigration is about people moving across borders.
If your stuff crosses borders either with you or on its own, such as mailed home, it will go through customs. Customs officials have the right to examine your stuff to see if it complies with what you are allowed to move over borders.
Individual countries all have customs officers. They are pretty obvious when you go in or out of Schengen, Ireland, the UK, and the US. Even if you don't see them as you travel from Schengen country to Schengen country they are around, sometimes in plain clothes.
Immigration is all about you moving from country to country and whether or not you are entitled to. Again they are most visible in the places noted above, but every country has them.
The two branches are usually spoken of together but I hope you can see that they are really different functions.
In the UK, when you land, you usually claim your bags then see the immigration officer. After they stamp your passport you walk down a faceless passageway with some one way mirrors behind which are most of the customs officials, perhaps with one or two in the passageway. If none of them pull you in, or unless you have something to declare, you go through some one-way doors and are in the public area of the airport where, as you say, you are on your merry way.
My memory, a few years old now, is that US customs and immigration is a pretty rigorous process. I remember customs finding an orange seed that was in my bag and confiscating that.