For a long time now, Google has included website speed in its rating and ranking algorithm used by the search engine. This means that pages that load faster (= are better optimized) have bigger chances for higher positions.
Interestingly, Google doesn’t simply measure the loading time (which can also be very relative, taking into account Internet connection speed, location, etc.). To a large extent, it focuses on optimization—or rather on the degree to which a specific list of optimization recommendations was followed.
Let’s also remember that we live in the times of mobile-first — i.e., the speed of loading a website on mobile devices is even more important than its speed on computers. A situation where the site works fast on a computer but is extremely slow on a smartphone is very common. The above mentioned (and listed below) measuring tools come to the rescue.