Pectin is a polysaccharide within tomatoes that has the ability to bind to itself and to other molecules, especially water, around it. This enables it to create a gel-like matrix, dependent on the amount within the solution. Water is a large part of ketchup, due to it being 80% of the composition of distilled vinegar.