Diffrenece between animation from css and javascript

what is the difference when we change animation speed using set interval in javascript and changing speed using speed variable form css code, or are both doing same thing?

got it, the js code is changing the inner values