Some examples:
1. "He is as happy as a pig in mud."
2. "He is happy, like a pig in mud."
In 1., his level of happiness is the same as the level of happiness of a pig in mud.
In 2., his happiness is similar/comparable to the happiness of a pig in mud.
3. "John does a good job as the doorman of our club."
4. "John does a good job, like the doorman of our club."
In 3., John is the doorman of our club, and in that capacity, John does a good job.
In 4., John is not the doorman of our club, but John does a good job, and the doorman of our club also does a good job, and I am comparing what a good job John does to the good job that the doorman does.
5. "He ran fast as lightning."
6. "He ran like lightning."
In 5., he ran at the same speed as lightning. Native speakers would say this, but it may be better to say "He ran as fast as lightning."
In 6., he ran in a similar way to the way that lightning travels, and you can infer that this means at a similar speed, because speed is the most obviously characteristic property of lightning.