In short, what funneling does is eliminate possible paths that your units might take in order to make them take the path you want. This can be done with almost every troop, and it relies on knowing how target selection works.
To get started, most troops will attack whatever building or object they prioritize that is closest to them, with some variations. Any unit that has a favorite target will only target those buildings (or walls if they need to be destroyed to reach those buildings) until none are left before targeting other things, however they still prioritize things close to them. However, units can prioritize buildings that are somewhat further away than others, if the ones somewhat closer are blocked off by walls, and therein lies the crux of the problem.
If you attack a base from one side and just dump all of your troops in one spot, they will attack the closest thing to them, then move to the next closest thing, this often causes the troops to spread out and start walking around the base instead of moving towards the core of the base (see picture below for reference).
This obviously is not what we want. We want our troops to go towards the middle and take out priority targets. Most of the time, players will have their townhall near the middle, and if you can't get your troops to go into the core of the base, you will not be able to even 2 star the base. Instead of dropping all the troops together as in the above picture, if you first dropped a few archers or wizards to take out the army camps and builder hut in the bottom middle and the elixir pumps and gold mine on the left side of the base before dropping the rest of your troops near the picture of the giant, your troops wouldn't split around the base, and would actually go into the core of the base and be able to get to the critical targets.
This is a very important thing to do especially with Pekkas and dragons, which are notorious for running around the outside of the base, as it will stop your troops from splitting up as much.
A few other tips that can help create a good funnel is proper use of wall breakers, jump spells, and earthquake spells. These all focus on eliminating walls so that you troops will target the buildings behind them, essentially eliminating the block which would force them to walk further to hit a more accessible target.
It is also important to note that wall breakers will target the closest wall with something behind it, and need to be funneled as well. If you destroy building to the side of the wall you want destroyed, the wall breakers will be more likely to destroy the walls you want them too. Also, if you drop 4 wall breakers at the same time, and it only takes 2 to destroy a wall, if all 4 survive, only two will explode to destroy the wall and the other two will retarget based on their current position allowing them to target the second row of walls, whereas if you dropped two and waited for the wall to be destroyed before dropping another two, the second two may run to a completely different wall to open another compartment in the outerwall.
Picture was retrieved from here