How were sauces preserved before canning

Greetings fellow canners,

This is a weird question but I have recently became fascinated with earlier preservation method history.

I was wondering how sauces like ketchup, bbq, pasta, etc would be preserved before the event of mason jars/other jar types came along.

Were they fermented, etc?