Speed is considered one of many ranking factors. I think less because Google explicitly says "we will rank you higher if your site is faster" and more "the user behaviors we track will improve if your site is faster".
This is things like going from the SERP -> Site -> Back to the SERP.
That's implicitly telling Google that the site didn't satisfy their search intent and something they for sure track.
Maybe the user clicked back b/c the page didn't load fast enough, maybe the content was bad but either way it's a search quality signal.