When Rick's spaceship won't start, he finds the problem lurking within the Microverse Battery. Literally within. There's a reason it's called a “microverse” battery: an entire micro-planet dwells inside. Rick had tricked the Microverse people by giving them the Goober Steps, a kinetic device that can power their electricities. What they don't know is that they also charge Rick's battery. This horrifies Morty because he views it as slavery, though Rick denies it.
Rick's not the only one who thought of this: the Microverse's head scientist, Zeep Xanflorp is the reason why the battery stopped working. He created a Miniverse and tricked them into producing energy to power up their world as well as the Microverse. Rick is not pleased and hypocritically calls Zeep out.
Zeep soon puts two and two together and realizes his entire existence has been a lie; a tool for a bigger species. The Miniverse's head scientist also figures it out and commits suicide with the only vehicle that would have taken them back home, stranding Rick, Morty, and Zeep in the middle of the woods. That doesn't stop Rick and Zeep from fighting each other every chance they get. Fed up, Morty storms out, only to return months later as a member of the Tree People. Unable to deal with the daily foibles of a tribal culture, Morty forces Rick and Zeep to work together so they can get the heck out of this world.
Rick and Zeep successfully improvise a device that unshrinks them, but just as it looks like they might get along, Zeep races back to headquarters to prevent Rick from destroying his world. After a lengthy pursuit, Rick and Morty beats Zeep (literally in the former's case) and returns to Earth, battery now activated. Zeep figured he had two choices: either get his people back on the Goober Steps or risk having his entire planet wiped out.
Zeep carries much of Rick's personality and traits: superior intelligence, pride, and a towering amorality that motivates his mad projects. It's no wonder he and Rick were in constant stalemate for so many months. Perhaps they would have kept on fighting until their last breaths, but the difference between the two becomes startlingly clear when Morty puts a stop to their rivalry. Maybe Zeep needs to get a Morty of his own.