As shown in Friend or Foe, Mr. Krabs and Plankton started out as best friends since they were both born in the same hospital on the same day. During their school years, both Plankton and Mr. Krabs were frequently bullied by the other children. When their favorite hang-out spot, Stinky Burgers, was shut down due to health violations, Plankton and Mr. Krabs decided to open their own burger joint to earn respect from the kids.
After creating their first burger, they got Old Man Jenkins to try the first bite. Unfortunately, Jenkins died from eating the food. This sparked in a fight between Mr. Krabs and Plankton, stating that one of them did something wrong. Their fight caused the recipe to be ripped in half, Plankton's half read "a pinch of chum". After Plankton left, he slammed the door, which caused various food items to fall off a shelf and into the patty patter, giving Mr. Krabs the perfect recipe.
This incident caused Mr. Krabs to be adored by the other people for his new food sensation, while Plankton swore vengeance and attempted to steal the formula. The two have been at war ever since.
Although Mr. Krabs and Plankton despise each other, they still seem to show sympathy for each other. Perhaps the best example is in New Leaf, where Mr. Krabs felt heartbroken upon apparently believing that Plankton had changed. The two later make amends and go to a carnival, where Mr. Krabs eventually gave Plankton the Krabby Patty formula after accepting his change. Sadly, it was revealed that it was merely another plan by Plankton, though he didn't really get the formula as Mr. Krabs had tricked him with an even bigger scheme.
Another instance was in Best Frenemies, where Plankton and Mr. Krabs teamed up in order to steal a kelp shake. They ultimately succeeded, though they were affected by the shake's effect from drinking it. A playful side of their rivalry is shown when Mr. Krabs gives Plankton a ten-second head start in taking his formula, following a "friendly" chase.
In Christmas Who?, they were seen singing a Christmas carol together. They also both came to special gatherings at SpongeBob's house in SpongeBob Meets the Strangler, Party Pooper Pants, and A SquarePants Family Vacation. In ‘‘ Welcome to the Chum Bucket, it was revealed that Mr. Krabs goes to the Chum Bucket every Thursday night to play cards with Plankton. In The Other Patty, Mr. Krabs and Plankton teamed up to steal the Flabby Patty formula and to get revenge on SpongeBob for making them do so.
The fights between Mr. Krabs and Plankton sometimes get very unpleasant in certain situations, usually when one of them intends to kill the other. The most extreme example was in One Coarse Meal, where Mr. Krabs - upon discovering Plankton's fear of whales - dresses up as Pearl in order to scare Plankton for fun. The scaring continued for the course of 17 days, making Plankton refuse to come outside and having nightmares. Eventually, Plankton decided to lie on the road and wait for a bus to kill him. Krabs also didn't really care that Plankton wanted to kill himself (even though it would be considered murder if Plankton actually killed himself, since Krabs was the person who scared him into suicide). It also shows that Mr. Krabs may be just as evil, if not more evil as Plankton himself.
In The SpongeBob SquarePants Movie, Plankton steals King Neptune's crown and frames Mr. Krabs. This causes King Neptune to freeze Mr. Krabs and nearly kill him, only to be saved by SpongeBob and Patrick bringing the crown back from Shell City. Not only did Plankton finally steal the formula, but he also brainwashed everyone in Bikini Bottom, took over the town, and sent an evil mercenary named Dennis to kill SpongeBob and Patrick. Considering that the movie took place at the end of the series (according to Stephen Hillenburg), this shows that Plankton has become a complete monster, though ultimately failed to take over the world.
However, most of the battles between the two do get pretty cruel, with these just as examples.