Primer:
1.) MotoGP races are "sprints." There are typically no pit stops, just a ~45 sprint to the checker. There is an exception for changing weather conditions. If a race starts dry and rains (or starts wet and dries up), riders can come into the pit and swap for their second bike as long as it's shod with different tires (swap a bike with slicks for a bike with rains or vise versa). These are called "flag to flag" races.
2.) Every track is different, based off the length of the pit lane, but pitting to swap bikes takes between 35 and 50 seconds. Coming in to swap bikes is always a gamble. The rider has to assess how many laps are remaining in the race, how much time per lap is being lost to being on the wrong tire, and do the math to see if the time swapping bikes is worth it. There is no team radio. Riders are out there on their own making these decisions.
3.) Rain tires are amazing. These guys run a pace in the rain that I couldn't match in the dry on slicks. It must be fully wet for them to work, though, as they overheat in as little as a single lap in the dry and start throwing tread blocks.
4.) Slicks are similarly amazing... on a dry track. They are WORTHLESS in the wet. Not only are there no sipes to clear water from the tire compound, but it's also a temperature thing. I once crashed on slicks just from being held at track entrance for seven minutes. The difference between fresh off the warmers and seven minutes removed from the warmers was enough to basically turn them into ice skates. Now picture pouring down rain.
5.) If you're some kind of godlike rider who can stay upright on slicks in the rain, the next challenge is brakes. In the dry, these bikes run carbon-carbon composite brake rotors. Not only do they handle infinity-high temperatures, they weigh basically zero, so less rotating mass and therefore better bump compliance and quicker steering. The downside to that high-temperature operating window is the same as with slick tires: They HAVE to be hot to work. At all. In the rain, these bikes run iron rotors for this reason. A rider's second bike will be setup with rain tires and iron rotors in case of rain.
6.) The suspension setup is also different between a wet bike and a dry bike. In the dry, these bikes run super stiff suspension to handle the crazy braking and cornering loads. In the wet, they run softer setups for better traction.
With all of these things taken into account, what Brad Binder pulled off in the last three laps of this race is fucking impossible: