It's best if your grades are good from day 1. So if you are comparing your grades with someone who has a 4.0+ GPA, they definitely have an advantage over you.
Improvement is key. If your grades consistently improve over your high school career, that's the next best thing to having good grades the whole time. It shows that you continue to try harder, even as your classes get more advanced.
Take challenging classes. Colleges are probably most interested in how you did in your most challenging courses because it can give them an idea of how well you'll do in college. That's why many students think colleges weight junior year more than other years - you'll generally take your most challenging courses (to that point) in your junior year.
As long as your cumulative GPA is high enough to catch their attention, many schools will likely take a look at your transcript and see that you've improved. It's much better to improve than to start out with good grades and slack off.