It's interesting that people always say that the person who knows you better is always best. I think that, in general, that may be true, but it isn't always true!
Sometimes, if you go through one course with a prof., and really do it right (get outstanding grades, go to office hours, participate, etc) then that prof will write you an incredible letter based on that course. And because you've never done real work for them, or been involved with them in a real way, as opposed to some people you may know better, they might just write you an amazing reference...