Follow is a command that causes your character to follow another. They must accept the follow request for you to start following them, although the options under "options auto follow" will let you automatically accept follow requests from everyone, from friends, or from group members.
Unlike pursue, there is no skillcheck to continue following someone, and if they use Divine Hand or Visit you will go with them. However, you can't follow a witch on a broomstick, and if an exit is restricted (as with worshipper-only areas of temples) you can be left behind: following doesn't bypass the restriction. Similarly, if an exit is skillchecked (as with climb exits and swimming) it's possible to fail the skillcheck and be left behind.
The "unfollow" command stops you following someone, and the "lose" command stops someone following you.
Groups and following
If you're in a group, you'll automatically follow the group leader. You can also use "group follow <member(s)>" (or "group follow all") to follow other group members, and "group unfollow <member(s)>" to stop following them.
NPCs and following
Typically, minions will automatically follow you--and you may automatically follow them upon summoning them. Pets, too, usually follow you, although they may get left behind if you use Divine Hand.
Most other npcs will not accept follow requests; you'll have to use pursue or just manually go through the exits you see them go through. One exception is Khepresh of Hat, who will let you follow him and who periodically uses Visit. Another exception is the npc you must escort in Agatean family missions.