Generally, you can not separate out grades from the classes taken and say one is more important than the other. Great grades in easy course will not get you into highly selective colleges. And poor grades in difficult courses will also not get you an acceptance letter. You need to have good grades in strong courses to be competitive for the more selective colleges.
However, in dealing with public universities, grades are often more important than classes taken. Many public universities make admissions decisions primarily on the basis of your grades and standardized test scores.
I am not suggesting that if you are considering attending a public university that you take only easy classes. Some of the most selective of the public universities will not find that acceptable. But if you are looking at public universities in general, you should be more aware of what grades you are likely to receive when planning your class schedule.