For example, an employee is shooting for a big promotion. He's hopeful that he's going to get it. But his boss tells him that he's still not doing enough and won't get the role. If he was hopeless, he would simply give up, believing that there's no chance that he's going to get it this time. But if he was desperate, he would take additional uncouth or unexpected actions, like begging and pleading, or sabotaging the coworkers who also have a chance at the promotion. If those desperate attempts failed, then it would be hopeless.
I’m actually surprised about your listed definitions because as a native english speaker, those definitions seem definitively wrong to me, as desperation means exactly that you haven’t quite yet given up hope even though the situation is dire. “Desperate” is like an intense kind of desire, which in my mind is the opposite of hopelessness.
It's contextual, so if a friend is "desperate for a drink", it's not meant to be taken literally.
When the author says, "When I think of my time at Instacart, I remember desperation", I assume they were feeling actual hopelessness.