To win a motorcycle race, team, rider, and machine need to get as close as possible to extracting 100% of performance from both motorcycle and rider. In the Socratic Ideal of a motorcycle race, as the bike crosses the line, it runs out of fuel, explodes into a thousand pieces, the tires destroy themselves, and the rider drops down dead. That, however, would contravene the engine durability regulations, be extraordinarily expensive, and make winning a championship impossible.
Instead, what the riders and teams try to do is maximize the performance of the bike, and allow the rider to manage performance throughout the race. That means finding the right engine mapping to extract as much power as possible without burning through tires and fuel, and setting up suspension and electronics to keep as much edge grip, corner speed, and braking ability as possible for as long as possible.
In 2017 and 2018, tire consumption was often the limiting factor. Riders knew tire performance would drop significantly at some point, so they had to design their race strategy around that: either push hard from the beginning and manage to the end, or slow up the race and hope to keep as much performance as possible to make a dash for the end. Andrea Dovizioso was a master at this, which allowed him to control the races such that he could win them, or at least keep them close.