What's the benefit to using jQuery's .css() method rather than changing a class, with css defining the color change?

https://www.codecademy.com/courses/learn-jquery/lessons/jquery-style-methods/exercises/css-ii

As almost all projects include proper css stylesheets, isn’t it easier to manage all our css in the stylesheet, and use jQuery’s .addClass() method rather than using the .css() method?

What are the use cases where .css() is superior?