Charm person makes a humanoid “friendly” to you, as per the rules found in the Diplomacy skill, but it also allows you to issue orders to the target, making an opposed Charisma check to convince the target to do something that it would not normally do. How does that work?
The charm monster spell (and charm person by extension) makes the target your friend. It will treat you kindly (although maybe not your allies) and will generally help you as long as your interests align. This is mostly in the purview of the GM. If you ask the creature to do something that it would not normally do (in relation to your friendship), that is when the opposed Charisma check comes into play. For example, if you use charm person to befriend an orc, the orc might share his grog with you and talk with you about the upcoming raid on a nearby settlement. If you asked him to help you fight some skeletons, he might very well lend a hand. If you asked him to help you till a field, however, you might need to make that check to convince him to do it.
This spell functions like charm person, except that the effect is not restricted by creature type or size.
Targets One or more creatures, no two of which can be more than 30 ft. apart
Duration 1 day/level
This spell functions like charm monster, except that mass charm monster affects a number of creatures whose combined HD do not exceed twice your level, or at least one creature regardless of HD. If there are more potential targets than you can affect, you choose them one at a time until you must choose a creature with too many HD to affect.