Ketchup is part of a merry band of liquids called Non-Newtonian fluids. Mayonnaise, toothpaste, blood, paint, peanut butter and lots of other fluids respond to force non-linearly. That is, their apparent thickness changes depending on how hard you push, or how long, or how fast.
From the TED-Ed Lesson Why is ketchup so hard to pour? - George Zaidan
Animation by TOGETHER