Attack refers to a command the player gives to either his character or his pet.
Attack initiates general melee combat with the currently equipped weapon(s). Your character will continue to attack until the attack action is toggled off, an attempted attack generates an error message (e.g. facing the wrong way, out of range, you are stunned, etc.), or the target is dead. The speed at which you attack depends on your equipped weapon(s). Melee special attacks and some self-only healing abilities do not interrupt an auto-attack.
Also see Wand Usage section of Wands for how auto-attack works with wands.
Attack is a pet command that instructs the pet to attack its master's current target. This is the only way to get a pet in Passive mode to attack. Attack can also be used to specify your pet's target. Pets in Defensive or Passive will continue to attack the selected target, but pets set to Assist will always attack the player's current target.