Basically, there was a point in medicine's history where no one was watching anyone do fuck all and no one had any idea about how anything worked, so people would sell cure all tonics that were usually something sweet, drugs, and made up exotic ingredients. Sometimes they were scammers, sometimes they genuinely thought they were on to something. But the reason the Snake Oil Salesman is an old west story staple is because there were people wandering around selling 'medicine' that could do basically anything.