Both my mare and my gelding used to do this with me. It was nothing that I taught them, it was based on trust and respect. The only time I ever had a leadline on my gelding was when I was either using him with a student, or at a show (where I pretty much just used it out of respect for the barn owners & other competitors). You can use body language to "invite" your horse to follow you, and likewise to tell him or her that they need to stop, turn, get out of your space, whatever. It's all about body language & the relationship you have with your horse. I'm sure following can be taught as well, it's just never been something I've done. I'd rather my horse walk around with me because he enjoys my company, and not because I'm carrying a whip or something.