Your troops are only as smart as you are.

Yes, you need to provide a great deal of direction to keep them from suiciding for the cause.
Basically, when units are created, they are in "Defender" mode, which means "if any enemy units are in my immediate sight (or area), attack until destroyed or ordered to move" by you selecting them and moving them away from the enemy (who continues to shoot as long as they are in range).
Enemies have more personality. They can be cowards, pacifists, defenders, or pitbulls.