Why does the U.S. Senate have to confirm General Patraeus' appointment?

I thought the President, as Commander In Chief of the Armed Forces, could assign officers wherever he thought best. How does the Senate get in the picture?

Previous thread on this issue.